This patch contains some more tests for the pow and atan families of
opcodes; it should cover all the different possible combinations of
n, i, nc and nc.
Simon Glover
--- trans.old Sun Dec 2 20:00:01 2001
+++ trans.t Fri Dec 14 16:47:13 2001
@@ -288,37 +288,114 @@
ok 2
OUTPUT
The entry in core.ops for puts(s|sc) is missing a =cut and so
writes a load of junk in core_ops.pod. Applied patch fixes.
Simon
--- core.ops.oldThu Jan 3 15:46:20 2002
+++ core.opsThu Jan 3 15:46:54 2002
@@ -370,6 +370,8 @@
Print $1 to standard output stream
+=cut
+
op p
The enclosed patch brings the list of documentation in parrot.pod
up to date.
Simon
--- parrot.pod.old Sat Dec 8 21:24:15 2001
+++ parrot.pod Fri Jan 4 16:44:02 2002
@@ -36,6 +36,10 @@
Describes what PMCs are and how they work.
+=item F
+
+A brief description of Parrot's Just-In
As is perhaps not surprising, given the speed at which Parrot is
evolving, our introduction could do with a bit of an update. The
enclosed patch is a first attempt at this; in it, I've tried to
remove some of the most out-of-date information. Specifically:
* IVs and NVs are now INTVALs
The recent removal of the iton/ntoi ops in favour of an extended meaning
of set causes jakoc to break. Enclosed patch fixes.
Cheers,
Simon
--- jakoc.old Sat Jan 5 21:29:10 2002
+++ jakoc Sat Jan 5 22:29:03 2002
@@ -625,7 +625,7 @@
#
if (substr($a, 0, 1) eq 'I' and num_
We're missing a couple of files from the MANIFEST.
Simon
--- MANIFEST.oldSun Jan 6 15:06:12 2002
+++ MANIFESTSun Jan 6 15:07:09 2002
@@ -85,6 +85,7 @@
examples/mops/mops.rb
examples/mops/mops.scheme
global_setup.c
+hints/cygwin.pl
hints/darwin.pl
hints/mswin32.pl
hints/o
Currently, whenever we create a new string with a call to string_make,
we allocate the memory for it by a simple call to malloc (via
mem_sys_allocate in memory.c). However, we don't check the return value
of this call, so if the malloc fails, Parrot promptly segfaults
when we try to make the
Subject line says it all.
Simon
--- global_setup.c.old Sat Jan 5 14:00:01 2002
+++ global_setup.c Mon Jan 7 20:07:20 2002
@@ -15,6 +15,7 @@
#include "parrot/parrot.h"
/* Needed because this might get compiled before pmcs have been built */
+void Parrot_PerlUndef_class_init(void);
Enclosed patch fixes this warning:
io/io.c: In function `PIO_copy_stack':
io/io.c:277: warning: declaration of `new_stack' shadows global
declaration
Simon
--- io.c.oldTue Jan 8 17:40:19 2002
+++ io.cTue Jan 8 17:41:49 2002
@@ -274,11 +274,11 @@
* IO object. Later we wil
We changed from index to idx in the code, but not in the comments.
Simon
--- key.c.old Tue Jan 8 08:00:00 2002
+++ key.c Tue Jan 8 17:52:36 2002
@@ -217,7 +217,7 @@
/*=for api key key_element_type
-return the type of element of KEY
+return the type of element of KEY
=cut
In amongst all the unused parameter warnings, gcc throws up these two for
key.c:
key.c: In function `key_element_value_s':
key.c:275: warning: passing arg 2 of `find_bucket' from incompatible
pointer type
key.c: In function `key_set_element_value_s':
key.c:339: warning: assignment
fromsize and tosize are both UINTVALs, so copysize should be one too.
Simon
--- memory.c.oldWed Jan 9 17:36:41 2002
+++ memory.cWed Jan 9 17:37:44 2002
@@ -81,7 +81,7 @@
void *
mem_realloc(void *from, UINTVAL fromsize, UINTVAL tosize) {
-INTVAL copysize = (fromsize > tos
Two separate bugs:
1. The index checks should use && and not ||, or else they'll always be
true.
2. The check in key_inc has an off-by-one error.
Simon
--- key.c.old Wed Jan 9 17:58:59 2002
+++ key.c Wed Jan 9 18:01:33 2002
@@ -225,7 +225,7 @@
INTVAL key_element_type(struct
On Wed, 9 Jan 2002, Simon Glover wrote:
> Two separate bugs:
>
> 1. The index checks should use && and not ||, or else they'll always be
> true.
>
> 2. The check in key_inc has an off-by-one error.
>
> Simon
>
Better hold off on applying t
On Wed, 9 Jan 2002, Dan Sugalski wrote:
> At 06:39 PM 1/9/2002 +0000, Simon Glover wrote:
>
> > On Wed, 9 Jan 2002, Simon Glover wrote:
> >
> > > Two separate bugs:
> > >
> > > 1. The index checks should use && and not ||, or else they
On Wed, 9 Jan 2002, Dan Sugalski wrote:
> At 07:15 PM 1/9/2002 +0000, Simon Glover wrote:
> > OK, I think I've got it this time. The previous patch uncovered a bug in
> > perlhash.pmc; index is actually the offset of a particular key pair
> > within the perlhas
This time in perlarray.pmc; they're both simple off-by-one errors.
Patch below fixes.
I've also added a regression test to guard against the reoccurence of
the bug. I've put this, plus the existing PerlArray tests, in a separate
file, pmc_perlarray.t, in line with what we've done for hashe
Adds rx.t, removes duplicated rx.c and puts everything back in
alphabetical order.
Simon
--- MANIFEST.oldThu Jan 10 13:41:59 2002
+++ MANIFESTThu Jan 10 13:42:38 2002
@@ -187,10 +187,9 @@
pmc_pm.pl
register.c
resources.c
-rx.c
-rx.ops
runops_cores.c
rx.c
+rx.ops
stacks.c
s
This fixes a couple of nits in rx.c:
1. There's no newline at the end, which makes gcc unhappy.
2. We should use NULL, not 0 or "", for creating null pointers.
Simon
--- rx.c.oldWed Jan 9 22:35:14 2002
+++ rx.cThu Jan 10 14:14:36 2002
@@ -76,9 +76,9 @@
/*p
As the subject line says.
Simon
--- macro.t.old Tue Nov 13 02:00:01 2001
+++ macro.t Thu Jan 10 15:52:28 2002
@@ -1,6 +1,6 @@
#! perl -w
-use Parrot::Test tests => 8;
+use Parrot::Test tests => 9;
output_is( <<'CODE', <
The enclosed patch allows one to use the if op with a PerlArray,
as in:
new P0, PerlArray
if P0, TRUE
print "false\n"
end
TRUE: print "true\n"
end
Currently, this works the same way that if(@array) does in Perl, ie
it's false if and only if the arr
Well, actually two bugs.
The first is an off-by-one error in key.c than can cause parrot
to segfault if hash % NUM_BUCKETS happens to be zero.
The other is a bug in the PerlHash init() code that causes new PerlHash
PMCs to start with the wrong size.
Both fixed below; also tests to preven
On Fri, 11 Jan 2002, Gopal Rajaraman wrote:
> There seems to be a typo in either pmc.h or parrotpointer.pmc
>
> pmc.h has:
> PMC_private_GC_FLAG = 2 << 12
>
> but parrotpointer.pmc has
> void init () {
> SELF->data=NULL;
> SELF->flags=PMC_private_gc_FLAG; ## you get a compile
The latest version of jit2h.pl is taking a very long time to run on my
machine - upwards of two minutes, which is longer than the rest of the
build put together! It doesn't appear to be broken, as Parrot still
builds fine, but it is rather annoying. Any idea what's causing this
slow-down
Enclosed test checks that
if Px, ...
works with PerlString PMCs; these should be false if they are "", 0, or
are undefined, and true in every other case.
Simon
--- t/op/pmc_perlstring.t.old Sun Jan 13 12:30:21 2002
+++ t/op/pmc_perlstring.t Sun Jan 13 13:15:13 2002
@@ -1,6
It should be make, not make parrot.
Simon
--- docs/intro.pod.old Sun Jan 13 13:28:00 2002
+++ docs/intro.pod Sun Jan 13 13:28:12 2002
@@ -101,7 +101,7 @@
You'll then be asked a series of questions about your local
configuration; you can almost always hit return for each one. Finally
.timestamp should always be present but not on the MANIFEST,
so this patch gets manicheck.pl to ignore it.
Simon
--- manicheck.pl.oldThu Jan 3 02:00:01 2002
+++ manicheck.plMon Jan 14 20:31:12 2002
@@ -108,6 +108,7 @@
}
return 1 if ($file eq '.cvsignore');
+ return 1 if
On Mon, 14 Jan 2002, Nicholas Clark wrote:
> On Sun, Jan 13, 2002 at 02:14:08PM -0500, Dan Sugalski wrote:
> > So, I'm turning off the unused parameter warning for now to shut the .ops
> > file compiles up. After that point, all submitted patches must generate no
> > more warnings than were cu
On Tue, 15 Jan 2002, Dan Sugalski wrote:
> At 04:39 PM 1/15/2002 +, Alex Gough wrote:
> >On Tue, 15 Jan 2002, Simon Glover wrote:
> >
> > >warning: control reaches end of non-void function
> > >
> > > I'm not sure what to do about the fo
These are happening because although pmc2c.pl is writing out a header
file, it isn't putting an #include directive into the C code to tell
it to use the file - this is only happening for the superclasses of the
PMC (which is generally only default at the moment). Patch below fixes.
NB. Ther
Enclosed patch attempts to resynchronize the core.ops documentation
with the actual code. It also fixes a few typos and overlong lines.
Simon
--- core.ops.oldSat Jan 19 16:36:59 2002
+++ core.opsSat Jan 19 18:19:36 2002
@@ -218,8 +218,13 @@
=item B(in INT, in NUM)
+=item B(
Please, people, if you create new files, remember to add them to the
MANIFEST.
Simon
--- MANIFEST.oldMon Jan 21 12:17:34 2002
+++ MANIFESTMon Jan 21 12:18:47 2002
@@ -75,6 +75,7 @@
examples/assembly/call.pasm
examples/assembly/euclid.pasm
examples/assembly/fact.pasm
+examples/
While you're online: now that you've split the io ops into their
own separate file, their documentation isn't going to core_ops.pod
any more. The enclosed patch fixes this by autogenerating io_ops.pod
in the same fashion that core_ops.pod is generated, but I'm not sure
whether this is the r
If you decide to apply the last patch, you should probably apply this
one as well, so that people know about the new file. If not, then junk
'em both.
Simon
--- parrot.pod.old Mon Jan 21 12:56:15 2002
+++ parrot.pod Mon Jan 21 12:57:11 2002
@@ -31,6 +31,10 @@
A description of the c
Enclosed patch fixes the POD brokenness in Parrot::Assembler reported
by Steve Fink, and generally makes it more aesthetically pleasing.
I've also supplied the missing documentation for the
constantize_number and constantize_integer functions - could someone
who knows check that I've expla
Enclosed patch fixes a couple of bugs in the optimizer. The first was
that the parser wasn't correctly recognising register names - it needs
to check for these _before_ checking for labels, or else they're
incorrectly identified as labels. Strangely, this wasn't causing
any problems with t
On Mon, 21 Jan 2002, H.Merijn Brand wrote:
> perl vtable_h.pl
> make: *** No rule to make target `include/parrot/rxstacks.h', needed by
>`test_main.o'. Stop.
This exists (and has done for a couple of days) but isn't in the MANIFEST
at the moment (I've already sent a patch). Could that be c
On Mon, 21 Jan 2002, Simon Glover wrote:
> The other bug is a misplaced ? in the regex checking for integers.
> This makes the match non-greedy, so 1.0 (for example) gets
> split up into 1000 (which matches the regex) and 0.0 (which matches
> as a float the next time aro
Right: the real cause of the second bug is similar to what I thought it
was - when it sees a float, the regex engine first checks to see if it
is an integer by trying the substitution:
s/^(-?\d+)(?!\.)//
The problem is that when, say, 1.0 gets fed to this, and fails
to match, th
On Mon, 21 Jan 2002, Brent Dax wrote:
>
> If the problem is backtracking, can't you just use the (?>)
> no-backtracking syntax?
>
Didn't think of that. I'm a bit concerned at the large warning
signs attached to it in perlre.pod, though.
Simon
From interpreter.h:
INTVAL flags;/* Various
interpreter flagBut whBut what
that signal that runops
should do something */
I'd supply a patch, but I'm not
At the moment, the assembler doesn't seem to like single character
labels. For instance, this code:
bsr aa
print "Didn't branch \n"
end
aa: print "Branched \n"
end
prints "Branched", as one would expect, but this code:
bsr a
print "Didn't br
There is no opcodes.pod; I'm assuming the pointer should actually be to
parrot_assembly.pod, as the canonical documentation.
Simon
--- overview.pod.oldMon Jan 28 19:42:55 2002
+++ overview.podMon Jan 28 19:43:06 2002
@@ -65,7 +65,7 @@
These areas will roughly map to compilation
You forgot to declare the class_init function in global_setup.h
Enclosed patch fixes.
Simon
--- global_setup.h.old Tue Jan 29 12:11:59 2002
+++ global_setup.h Tue Jan 29 12:12:29 2002
@@ -15,6 +15,7 @@
#define PARROT_GLOBAL_SETUP_H_GUARD
/* Needed because this might get compiled be
As written, the tests of the new neg op will pass even if neg does
nothing. Enclosed patch fixes by extending the tests.
Simon
--- integer.t.old Tue Jan 29 14:48:54 2002
+++ integer.t Tue Jan 29 14:49:51 2002
@@ -1014,11 +1014,14 @@
output_is(<
Enclosed patch adds the new SPARC-based JIT files to the manifest,
and also puts it back into alphabetical order.
Simon
--- MANIFEST.oldWed Jan 30 11:42:42 2002
+++ MANIFESTWed Jan 30 11:46:42 2002
@@ -6,35 +6,9 @@
MANIFEST
Makefile.in
NEWS
-lib/Parrot/Assembler.pm
-lib/Parrot
In embed.h, we declare a function:
struct Parrot_Interp *interp_new();
that's never subsequently used. On the other hand, in embed.c,
we use a function
struct Parrot_Interp * Parrot_new() { ...
that isn't previously declared. Are these supposed to be the same thing?
If so, the patch
This patch clears up warnings in embed.c and test_main.c coming
from function declarations of the form:
void
foobar();
which should properly be
void
foobar(void);
Simon
--- test_main.c.old Tue Jan 29 20:00:01 2002
+++ test_main.c Wed Jan 30 12:05:36 2002
@@ -18,10 +18,10 @@
p
Many of the Perl scripts in the distribution (including assemble.pl !)
can no longer find the Parrot::* modules. Enclosed patch fixes (although
it would be nice if there were an easier way to do this).
Simon
--- languages/scheme/Scheme/Test.pm.old Wed Jan 30 17:42:08 2002
+++ languages/sch
Oops, scratch a couple of those; the pmc2c.pl one's not necessary,
and I see Daniel's already patched pbc2c.pl
Simon
I posted this patch a while back, but it seems to have slipped
through the cracks. It fixes the POD in Parrot::Assember so that perldoc
can read it and just tidies it up generally. It also adds documentation
for the constantize_integer and constantize_number functions.
Simon
--- lib/Parro
On Wed, 30 Jan 2002, Steve Fink wrote:
> On Wed, Jan 30, 2002 at 09:32:45PM +, Nicholas Clark wrote:
> >
> > Should I add classes/array.c classes/array.h docs/embed.pod docs/io_ops.pod
> > to MANIFEST?
>
> *.pod, yes. classes/*.[ch], no. Autogenerated.
>
Erm, io_ops.pod is also autogen
Enclosed patch fixes this warning:
embed.c: In function `Parrot_runcode':
embed.c:174: warning: int format, INTVAL arg (arg 3)
Simon
--- embed.c.old Fri Feb 1 13:49:46 2002
+++ embed.c Fri Feb 1 13:49:48 2002
@@ -171,7 +171,7 @@
for(i=0; i < argc; i++) {
if(inte
Slight fix to the string->int test that we're currently skipping in
pmc.t; the test still fails, but no longer makes Parrot segfault.
Simon
--- t/pmc/pmc.t.old Fri Feb 1 17:20:22 2002
+++ t/pmc/pmc.tFri Feb 1 17:24:49 2002
@@ -558,6 +558,7 @@
set I0, P0
print
There are a number of set ops documented in core.ops that haven't
actually been implemented - conversion from STR to INT/NUM (and
vice versa), plus conversion from PMCs to STR.
The enclosed patch implements the last of these, and adds tests for
PerlUndefs and PerlStrings (and implicitly
On Fri, 1 Feb 2002, Alex Gough wrote:
> On Fri, 1 Feb 2002, Simon Glover wrote:
>
> > The enclosed patch implements the last of these, and adds tests for
> > PerlUndefs and PerlStrings (and implicitly PerlInts and PerlNums -
> > should we also add explicit test
OK, I've revised the tests for C in line with Alex's
concerns, and added explicit tests for PerlInts and PerlNums. As yet
there are still no PerlArray or PerlHash tests.
Re the former, am I right in thinking that assignment from a PerlArray
to a non-PMC register should always be in scalar
On Mon, 4 Feb 2002, Alex Gough wrote:
> On Mon, 4 Feb 2002, Simon Glover wrote:
>
> > Re the former, am I right in thinking that assignment from a PerlArray
> > to a non-PMC register should always be in scalar context; ie that:
> >
> > new P0,
Most of the PerlUndef tests in pmc.t appear to have been added twice.
Enclosed patch removes the duplicates.
Simon
--- t/pmc/pmc.t.old Tue Feb 12 15:23:30 2002
+++ t/pmc/pmc.t Tue Feb 12 15:25:07 2002
@@ -1,6 +1,6 @@
#! perl -w
-use Parrot::Test tests => 61;
+use Parrot::Test tests =>
Currently the add, subtract, multiply and divide methods in perlnum.pmc
are all coded along the lines of:
void add (PMC * value, PMC* dest) {
if(value->vtable == &Parrot_base_vtables[enum_class_PerlInt]) {
*dest->vtable = &Parrot_base_vtables[enum_class_PerlNum];
*
Enclosed patch fixes a few small bugs in the core.ops documentation.
Simon
--- core.ops.oldSat Feb 16 17:08:02 2002
+++ core.opsSat Feb 16 17:29:12 2002
@@ -575,7 +575,7 @@
=head2 Conditional branch operations
-These opertions perform a conditional relative branch. If the c
The enclosed patch fixes a few of the holes in our test coverage
uncovered by Josh Wilmes
Simon
--- t/op/integer.t.old Sat Mar 9 15:38:21 2002
+++ t/op/integer.t Sat Mar 9 15:55:33 2002
@@ -1,6 +1,6 @@
#! perl -w
-use Parrot::Test tests => 30;
+use Parrot::Test tests => 32;
o
Should be self-explanatory.
Simon
--- rx.ops.old Sun Mar 10 12:54:51 2002
+++ rx.ops Sun Mar 10 12:55:18 2002
@@ -16,7 +16,7 @@
# NOTE: This looks a LOT scarier than it really is
# "zzabbBBcdcdcdzz" =~ /ab*[cd]+/i
- rx_allocateinfo P0, "zzabbBBcdcd
Enclosed patch fixes up a few more holes in our test coverage.
Simon
--- t/op/rx.t.old Sun Mar 10 13:14:34 2002
+++ t/op/rx.t Sun Mar 10 13:36:01 2002
@@ -1,4 +1,4 @@
-use Parrot::Test tests => 22;
+use Parrot::Test tests => 27;
use Test::More;
sub gentest($$;$$) {
@@ -64,
Self-explanatory.
Simon
--- time.t.old Sun Mar 10 13:47:03 2002
+++ time.t Sun Mar 10 13:48:46 2002
@@ -1,6 +1,6 @@
#! perl -w
-use Parrot::Test tests => 3;
+use Parrot::Test tests => 4;
output_is(<<'CODE', <<'OUTPUT', "time_i");
timeI0
@@ -64,4 +64,10 @@
start
done
O
More tests for the PerlString test-suite.
Simon
--- t/pmc/perlstring.t.old Sun Mar 10 14:14:16 2002
+++ t/pmc/perlstring.t Sun Mar 10 17:14:29 2002
@@ -1,8 +1,51 @@
#! perl -w
-use Parrot::Test tests => 6;
+use Parrot::Test tests => 8;
use Test::More; # Included for skip().
In Parrot's standard operational mode, the following code[1]:
set N2, -2147483648.0
set I2, N2
print I2
print "\n"
end
produces the output:
-2147483648
but in JIT mode (on an x86) it produces:
-0
This smacks of some kind of overfl
For more fun in the same vein, try this:
length S0
end
In both cases the problem is that we're not checking the STRING*
pointer passed to the function before we start trying to dereference it.
This seems to be a fairly generic problem in the string functions,
unfortunately - a brief lo
On Mon, 11 Mar 2002, Nicholas Clark wrote:
> On Sat, Feb 16, 2002 at 10:32:10PM +0000, Simon Glover wrote:
>^
> Should I apply the revised patch as appended?
>
Looks like a few bits have already been patched. Try the attached
instead.
Simon
--- core.ops.ol
This is a repost of another rather ancient patch, but should be
uncontroversial - basically, the PerlUndef tests appear to have
been committed twice; the patch just removes the duplicates.
Simon
--- t/pmc/pmc.t.old Tue Feb 12 15:23:30 2002
+++ t/pmc/pmc.t Tue Feb 12 15:25:07 2002
@@ -1,
Enclosed patch updates the manifest to match reality.
Simon
--- MANIFEST.oldWed Mar 13 18:43:05 2002
+++ MANIFESTWed Mar 13 18:43:43 2002
@@ -56,6 +56,7 @@
docs/pdds/pdd11_extending.pod
docs/pdds/pdd12_assembly.pod
docs/pdds/pdd13_bytecode.pod
+docs/pdds/pdd14_bignum.pod
docs
On Fri, 15 Mar 2002, Simon Cozens wrote:
> Here's how to play with it:
>
> 1) CVS update and build Parrot
> 2) "make packout.o"
This step spews a load of warnings of the form:
packout.c:22: warning: no previous prototype for `PackFile_pack_size'
packout.c: In function `PackFile_pack
On Fri, 15 Mar 2002, Simon Cozens wrote:
> You didn't resync. I just updated packout.c to take this function out.
> There's a reason step 1 included CVS updating. :)
Yep, just figured that out for myself - I rsync'd, rather than doing a
cvs checkout, and not realizing it doesn't do quite the
OK, I've finished trying it out on all of the files in examples/assembly.
Most of them assemble and run fine. The ones that don't are:
call.pasm: it has problems with things like [D - @ - 3] in the macros
fact.pasm, local_label.pasm: it doesn't handle local labels like $ok
stack.pasm
On Fri, 15 Mar 2002, Simon Glover wrote:
>
> stack.pasm: it can't handle the expanded opcode names like set_i_ic
>
This actually seems to be quite easy to fix - we just return early from
expand_op is the opcode is already in expanded form. Patch again newasm
att
I thought I'd try out newasm on the test suite - this is how we do:
Failed Test Status Wstat Total Fail Failed List of failed
-
t/op/basic.t 2 512 82 25.00% 3, 7
t/op/bitwise.t 15 384015 15 100.00% 1-15
I'm a bit confused about the relationship between PDD6 and Simon's new
Assembler PDD. Is the latter supposed to replace the former, or are
they supposed to be addressing different aspects of Parrot Assembler?
Simon
Enclosed patch gets rid of these warnings:
default.pmc: In function `Parrot_default_get_integer_keyed':
default.pmc:50: warning: control reaches end of non-void function
default.pmc: In function `Parrot_default_get_number_keyed':
default.pmc:58: warning: control reaches end of non-void func
The enclosed patch demangles the documentation of the C opcode.
Simon
--- core.ops.oldMon Mar 18 18:49:07 2002
+++ core.opsMon Mar 18 18:51:28 2002
@@ -2526,16 +2526,18 @@
=item B(out PMC, in INT, in INT)
-Create a new PMC of class C; look in F for the base
+Create a new PMC of
It's FLOATVAL, not NUMVAL.
Simon
--- README.old Tue Jan 29 01:01:40 2002
+++ README Mon Mar 18 20:11:50 2002
@@ -33,7 +33,7 @@
make, but you'll be unable to assemble anything.) You can find
what types are support by typing 'perl -V', and examining the
values for ivtype and nvtype.
We can now get usage information for test_parrot without having to
grep the source.
Simon
--- docs/running.pod.oldTue Mar 19 09:57:02 2002
+++ docs/running.podTue Mar 19 09:57:45 2002
@@ -40,7 +40,7 @@
running C.
C also has several debugging and tracing flags; see the
1. There are tests in t/pmc as well as t/op now.
2. Adds a comment about Parrot::Test
Simon
--- docs/tests.pod.old Tue Mar 19 10:27:52 2002
+++ docs/tests.pod Tue Mar 19 10:38:52 2002
@@ -8,9 +8,17 @@
=head2 How to write a test
-First, find an appropriate file in C, or create a new
The description in core.ops is a little terse. How about this:
--
Set $1 to the portion of $2 starting at (zero-based) character position
$3 and having length $4.
Optionally pass in string $5 for replacement. If the length of $5 is
different from the length specified in $4
On Thu, 21 Mar 2002, Michel J Lambert wrote:
> +//KEY_PAIR src_key_p, dest_key_p;
> +//KEY src_key, dest_key;
[etc.]
These need to be C-style comments; not every compiler will accept the
C++ style ones.
Simon
Self-explanatory patch.
Simon
--- MANIFEST.oldSun Mar 24 16:03:02 2002
+++ MANIFESTSun Mar 24 16:03:39 2002
@@ -72,6 +72,7 @@
examples/assembly/Makefile
examples/assembly/bsr.pasm
examples/assembly/call.pasm
+examples/assembly/cat.pasm
examples/assembly/euclid.pasm
examples/
This code:
set I0, 0
FOO: set S0, I0
savec S0
inc I0
lt I0, 256, FOO
rotate_up 2
restore S1
print S1
print "\n"
end
makes Parrot segfault. This seems to be due to an off-by-one error in
stack_entry(..) that uncovers itself if depth==ch
The enclosed patch adds tests for the new and ops,
and also provides a test for the bug described in my previous email.
Simon
--- t/op/stacks.t.old Sun Mar 24 16:35:26 2002
+++ t/op/stacks.t Sun Mar 24 17:45:23 2002
@@ -1,6 +1,6 @@
#! perl -w
-use Parrot::Test tests => 15;
+use P
This code:
set I0, 0
TOP: bsr FOO
inc I0
lt I0, 974, TOP
print "Done\n"
end
FOO: new P0, PerlString
set P0, "foo"
pushp
ret
end
causes a segfault, while the same program with 974 changed to 973 (or
smaller) runs fine.
Running parrot under gdb sh
--- MANIFEST.oldSat Apr 6 13:35:21 2002
+++ MANIFESTSat Apr 6 13:37:17 2002
@@ -163,6 +163,7 @@
languages/cola/cola.l
languages/cola/cola.y
languages/cola/examples/calc.cola
+languages/cola/examples/expressions.cola
languages/cola/examples/fib.cola
languages/cola/examples/life
This patch contains several more tests for the stack ops, in
particular for rotate_up.
Simon
--- t/op/stacks.t.old Sat Apr 6 13:47:09 2002
+++ t/op/stacks.t Sat Apr 6 14:58:01 2002
@@ -1,6 +1,6 @@
#! perl -w
-use Parrot::Test tests => 20;
+use Parrot::Test tests => 28;
use Test:
Enclosed patch adds a number of tests for the 5-argument form of
substr.
Simon
--- t/op/string.t.old Sat Apr 6 19:56:32 2002
+++ t/op/string.t Sat Apr 6 20:38:59 2002
@@ -1,6 +1,6 @@
#! perl -w
-use Parrot::Test tests => 64;
+use Parrot::Test tests => 76;
output_is( <<'CODE',
The enclosed patch expands (and hopefully clarifies) the documentation
for rotate_up, plus fixes one or two other niggles in the docs.
Simon
--- core.ops.oldSat Apr 6 19:12:43 2002
+++ core.opsSat Apr 6 21:12:42 2002
@@ -229,8 +229,13 @@
=item B(in INT, in NUM)
+=item B(in I
The enclosed patch makes a number of changes to perlstring.pmc, to bring
it in line with my understanding of how PMCs are supposed to work.
Specifically, unless we _know_ the type of the source and destination PMCs,
we should always access them through their get_... and set_... methods.
In
We no longer pass a PMC pointer into pmc_new, but the comment hasn't been
changed to reflect that. Patch below corrects, and also adds an
appropriate comment for pmc_new_sized.
Simon
--- pmc.c.old Thu Apr 11 18:02:16 2002
+++ pmc.c Thu Apr 11 18:17:30 2002
@@ -16,14 +16,12 @@
#incl
This patch tidies up a few of the comments in string.c, and fixes one
actual documentation bug -- namely, string_chopn removes the last
n _characters_, not the last n _bytes_.
Simon
--- string.c.oldThu Apr 11 19:01:31 2002
+++ string.cThu Apr 11 19:06:47 2002
@@ -87,7 +87,7 @@
Looks pretty good here. One minor thing I noticed: the change to
string_grow means that we've got an unused local variable, which
the patch below gets rid of.
Simon
--- string.c.oldMon Apr 15 14:55:09 2002
+++ string.cMon Apr 15 14:59:56 2002
@@ -72,7 +72,6 @@
*/
STRING *
st
This patch tidies up the formatting of string_substr and string_replace,
adds a bunch of comments, and moves a couple of assignments closer to
where the variables are actually used; none of the functionality should
be affected. All tests still pass (including the ones in a previous patch
tha
What should the substr ops produce if given a negative length argument?
At the moment, the four-arg. form hands back an empty string, while
the five-arg. form hands back a copy of the original string, ie:
set S0, "abcdefg"
substr S1, S0, 0, -1
print S1
print "\n"
and
set S2, ""
On Mon, 15 Apr 2002, Dan Sugalski wrote:
> At 10:26 PM +0200 4/15/02, Peter Gibbs wrote:
> >
> >Note that string_grow still has the problem with not bothering to allocate a
> >new buffer if copysize is zero, e.g. if we are expanding a previously empty
> >buffer.
> >
> >I have submitted a patch f
Compiling parrot with gcc's -Wredundant_decls option shows up a few
places where we're declaring functions twice in the same header file.
Patch below fixes.
Simon
--- include/parrot/chartype.h.old Tue Apr 16 22:33:46 2002
+++ include/parrot/chartype.h Tue Apr 16 22:31:56 2002
@@ -48
1 - 100 of 295 matches
Mail list logo