Ticket #986: kill-strstart.patch
File kill-strstart.patch, 2.9 KB (added by darbelo, 12 years ago) |
---|
-
compilers/imcc/pbc.c
1213 1213 1214 1214 PMC_get_sub(interp, sub_pmc, sub); 1215 1215 IMCC_debug(interp, DEBUG_PBC_CONST, 1216 "add lexical '%s' to sub name '% s'\n",1217 n->name, (char*)sub->name->strstart);1216 "add lexical '%s' to sub name '%Ss'\n", 1217 n->name, sub->name); 1218 1218 1219 1219 Parrot_PCCINVOKE(interp, lex_info, 1220 1220 string_from_literal(interp, "declare_lex_preg"), … … 1255 1255 subs_t *s; 1256 1256 PMC *current; 1257 1257 STRING *cur_name; 1258 char *cur_name_str; 1258 1259 Parrot_Sub_attributes *sub; 1259 1260 size_t len; 1260 1261 … … 1289 1290 PMC_get_sub(interp, current, sub); 1290 1291 cur_name = sub->name; 1291 1292 1292 if (cur_name->strlen == len 1293 && (memcmp((char*)cur_name->strstart, unit->outer->name, len) == 0)) 1293 cur_name_str = Parrot_str_to_cstring(interp, sub->name); 1294 if (strlen(cur_name_str) == len 1295 && (memcmp(cur_name_str, unit->outer->name, len) == 0)) { 1296 Parrot_str_free_cstring(cur_name_str); 1294 1297 return current; 1295 1298 } 1299 Parrot_str_free_cstring(cur_name_str); 1296 1300 return NULL; 1297 1301 } 1298 1302 … … 1511 1515 PMC_get_sub(interp, sub->outer_sub, outer_sub); 1512 1516 1513 1517 IMCC_debug(interp, DEBUG_PBC_CONST, 1514 "add_const_pmc_sub '%s' flags %x color %d (% s) "1515 "lex_info %s :outer(% s)\n",1518 "add_const_pmc_sub '%s' flags %x color %d (%Ss) " 1519 "lex_info %s :outer(%Ss)\n", 1516 1520 r->name, r->pcc_sub->pragma, k, 1517 (char *) sub_pmc->vtable->whoami->strstart,1521 sub_pmc->vtable->whoami, 1518 1522 sub->lex_info ? "yes" : "no", 1519 sub->outer_sub ? 1520 (char *)outer_sub->name->strstart : 1521 "*none*"); 1523 sub->outer_sub? outer_sub->name : 1524 Parrot_str_new(interp, "*none*", 0)); 1522 1525 1523 1526 /* 1524 1527 * create entry in our fixup (=symbol) table -
compilers/pirc/src/bcgen.c
912 912 PMC *current; 913 913 Parrot_Sub_attributes *sub; 914 914 STRING *cur_name; 915 STRING *out_name; 915 916 size_t len; 916 917 global_label *outersub; 917 918 … … 959 960 PMC_get_sub(interp, current, sub); 960 961 cur_name = sub->name; 961 962 962 /* XXX can't this be a call to Parrot_str_compare() ? */963 if ( cur_name->strlen == len && (memcmp((char *)cur_name->strstart, outername, len) == 0))963 out_name = Parrot_str_new(interp, outername, len); 964 if (Parrot_str_compare(interp, cur_name, out_name) == 0) 964 965 return current; 965 966 966 967 return NULL;