# New Ticket Created by Leopold Toetsch # Please include the string: [perl #16895] # in the subject line of all future correspondence about this issue. # <URL: http://rt.perl.org/rt2/Ticket/Display.html?id=16895 >
1) The following code snippet, appended to anyop.c strcpy(name, "shl_p_p_ic"); op = op_find_exact(name); if (!same_op(op, NULLOP)) { printf("%s found: = ", name); info = op_info(op); printf("%s\n",info->full_name); } gives this: $ cc -DTEST=1 -I../../include anyop.c -o anyop -ldl && ./anyop shl_p_p_ic found: = shr_i_i_ic i.e. non existing ops are found. 2) find_op should really not exit, when asked for non existing ops. 3) IN/OUT (same as last patch) 4) set P[k], i Here probably P should be a IN argument, because P itself is neither created nor changed, just the array/hash contents is changed. Currently only the JITters and imcc are using this flags, so, it should be discussed, what OUT really means. (imcc generates now almost all of the code with help from op_info_table) leo -- attachment 1 ------------------------------------------------------ url: http://rt.perl.org/rt2/attach/36172/29258/636b7d/ops2c.pl.diff -- attachment 2 ------------------------------------------------------ url: http://rt.perl.org/rt2/attach/36172/29259/1a7b6c/core.ops.diff
--- ops2c.pl Wed May 15 08:23:22 2002 +++ /home/lt/src/parrot-007/ops2c.pl Sat Aug 31 19:57:13 2002 @@ -401,8 +401,7 @@ int op; int i = 2; if((op = op_hash_jump[bucket]) == 0) { - printf("Invalid bucket for %s\\n", name); - exit(0); + return -1; } for(;;) { if(name[i] != op_hash[op].name[i]) { @@ -411,8 +410,12 @@ return -1; continue; } - if(name[i] == 0) - return op_hash[op].opcode; + if(name[i] == 0) { + int n = op_hash[op].opcode; + if (strcmp(op_info_table[n].full_name, name)) + return -1; + return n; + } i++; } }
--- core.ops Fri Aug 23 20:10:40 2002 +++ /home/lt/src/parrot-007/core.ops Thu Aug 29 12:24:40 2002 @@ -1492,7 +1492,7 @@ goto NEXT(); } -inline op div (out PMC, out PMC, out PMC) { +inline op div (out PMC, in PMC, in PMC) { $2->vtable->divide(interpreter, $2, $3, $1); goto NEXT(); } @@ -1591,7 +1591,7 @@ goto NEXT(); } -inline op mod (out PMC, out PMC, out PMC) { +inline op mod (out PMC, in PMC, in PMC) { $2->vtable->modulus(interpreter, $2, $3, $1); goto NEXT(); } @@ -1665,7 +1665,7 @@ goto NEXT(); } -inline op mul (inout PMC, out PMC) { +inline op mul (inout PMC, in PMC) { $1->vtable->multiply(interpreter, $1, $2, $1); goto NEXT(); } @@ -1680,7 +1680,7 @@ goto NEXT(); } -inline op mul (out PMC, out PMC, out PMC) { +inline op mul (out PMC, in PMC, in PMC) { $2->vtable->multiply(interpreter, $2, $3, $1); goto NEXT(); } @@ -1829,7 +1829,7 @@ goto NEXT(); } -inline op sub (out PMC, out PMC, out PMC) { +inline op sub (out PMC, in PMC, in PMC) { $2->vtable->subtract(interpreter, $2, $3, $1); goto NEXT(); } @@ -1898,7 +1898,7 @@ goto NEXT(); } -inline op concat (out PMC, out PMC, out PMC) { +inline op concat (out PMC, in PMC, in PMC) { $2->vtable->concatenate(interpreter, $2, $3, $1); goto NEXT(); }