# New Ticket Created by  Leopold Toetsch 
# Please include the string:  [perl #17025]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt2/Ticket/Display.html?id=17025 >


If this one is already in queue, bare with me.

find_op does either die or return false positives for non existing ops.

Please[1] apply,
leo

[1] I'd really like to get rid of my ever increasing imcc changes (~100K 
+100K generated parser/lexer), but I can't, because of core damage.




-- attachment  1 ------------------------------------------------------
url: http://rt.perl.org/rt2/attach/36594/29537/873f17/ops2c.pl.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++;
        }
 }

Reply via email to