- Timestamp:
- 10/28/08 16:39:10 (2 months ago)
- Location:
- v6/smop/SMOP
- Files:
-
- 3 modified
-
SMOP.xs (modified) (3 diffs)
-
lib/SMOP.pm (modified) (1 diff)
-
t/run_mold.t (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
v6/smop/SMOP/SMOP.xs
r22800 r22801 106 106 107 107 SV* 108 create(SV* p5class, SV* consts, SV* bytecode)108 create(SV* p5class, int ccount, SV* consts, int bcount, SV* bytecode) 109 109 CODE: 110 110 AV* constsav = (AV*)SvRV(consts); … … 112 112 SMOP__Object** consts_arr = calloc(constslen+1,sizeof(void*)); 113 113 int i; 114 for (i = 0; i < constslen; i++) {114 for (i = 0; i <= constslen; i++) { 115 115 SV** e = av_fetch(constsav,i,0); 116 116 SMOP__Object* object; … … 133 133 int codelen = av_len(codeav); 134 134 int* code_arr = calloc(codelen+1,sizeof(void*)); 135 for (i = 0; i < codelen; i++) {135 for (i = 0; i <= codelen; i++) { 136 136 SV** e = av_fetch(codeav,i,0); 137 137 code_arr[i] = SvIV(*e); 138 138 } 139 SMOP__Object* mold = SMOP__Mold_create(c onstslen, consts_arr, codelen, code_arr);139 SMOP__Object* mold = SMOP__Mold_create(ccount, consts_arr, bcount, code_arr); 140 140 SV* pointer = newSViv((int)mold); 141 141 SV* object = newRV_noinc(pointer); -
v6/smop/SMOP/lib/SMOP.pm
r22798 r22801 27 27 my $rootns = SMOP::S1P->RootNamespace; 28 28 my $prelud = SMOP::S1P->LexicalPrelude; 29 my $mold = SMOP::Mold->create( [$rootns, $int, $true, $fals],30 [1,2,3,1,2,3,1,2,3]);29 my $mold = SMOP::Mold->create(12,[$rootns, $int, $true, $fals], 30 45,[1,2,3,1,2,3,1,2,3]); 31 31 my $frame = SMOP::MoldFrame->create($mold); 32 32 my $result = SMOP::Interpreter->run($frame); -
v6/smop/SMOP/t/run_mold.t
r22799 r22801 5 5 6 6 my $submold = SMOP::Mold->create 7 ([ '$OUT','$_','FETCH','back','continuation', 7 (10, 8 [ '$OUT','$_','FETCH','back','continuation', 8 9 'goto','lookup','postcircumfix:{ }','print' ], 10 59, 9 11 [ 1,11,10,7,1,1,0,1,12,11,2,0,0,1,13,12,2,0,0,1, 10 12 15,10,6,1,0,0,1,16,15,2,0,0,1,14,16,8,1,13,0,1, … … 13 15 14 16 my $mold = SMOP::Mold->create 15 ([ SMOP::S1P->Capturize, 17 (13, 18 [ SMOP::S1P->Capturize, 16 19 SMOP::S1P->LexicalScope, 17 20 SMOP::S1P->Scalar, … … 22 25 $submold, 23 26 SMOP::S1P->LexicalPrelude ], 27 146, 24 28 [ 1,23,21,10,1,3,0,1,24,23,7,0,0,1,22,24,19,1,5,0,1,25,21, 25 29 10,1,6,0,1,26,25,7,0,0,1,27,1,12,0,2,16,21,1,28,27,16,0,
