Henrik Grubbstr?m (Lysator) @ Pike (-) developers forum wrote:
Thanks. Potentially fixed.
Sorry, whack-a-mole, I guess. The bug shifted, maybe it's more obvious now (you check for inh > 0, does that even work for pointers? Maybe that should be inh != 0 instead?):
-:2:No inherit or surrounding class foo.
Program received signal SIGSEGV, Segmentation fault. really_low_find_shared_string_identifier (name=name@entry=0x55555590a308, prog=prog@entry=0x0, flags=flags@entry=3) at /var/src/roxen/81pike/src/program.c:7392 7392 last_inh = prog->num_inherits; (gdb) where #0 really_low_find_shared_string_identifier (name=name@entry=0x55555590a308, prog=prog@entry=0x0, flags=flags@entry=3) at /var/src/roxen/81pike/src/program.c:7392 #1 0x000055555561c53f in find_inherited_identifier ( inherit_state=0x5555557e7140, inherit_depth=0, inh=0, ident=0x55555590a308) at /var/src/roxen/81pike/src/program.c:2249 #2 0x00005555555727ae in yyparse () at language.yacc:4230 #3 0x0000555555610b55 in do_yyparse () at /var/src/roxen/81pike/src/pike_compiler.cmod:362 #4 0x0000555555615185 in run_pass1 (c=0x5555557d4a00) at /var/src/roxen/81pike/src/pike_compiler.cmod:1050 #5 f_compilation_compile (args=0) at /var/src/roxen/81pike/src/pike_compiler.cmod:1657 #6 0x0000555555584d4f in lower_mega_apply (args=args@entry=0, o=o@entry=0x5555557ca2b0, fun=1) at /var/src/roxen/81pike/src/interpret.c:2285 #7 0x00005555555855f2 in jump_opcode_F_CALL_OTHER (arg1=13) at /var/src/roxen/81pike/src/interpret_functions.h:2424 #8 0x00007ffff753cdad in ?? () #9 0x0000000000000091 in ?? () #10 0x0000000000000000 in ?? () (gdb) list 7387 } 7388 #endif /* PIKE_DEBUG */ 7389 7390 id = -1; 7391 depth = 0; 7392 last_inh = prog->num_inherits; 7393 i = (int)prog->num_identifier_references; 7394 while(i--) 7395 { 7396 funp = prog->identifier_references + i; (gdb) p prog $1 = (const struct program *) 0x0 (gdb) up #1 0x000055555561c53f in find_inherited_identifier ( inherit_state=0x5555557e7140, inherit_depth=0, inh=0, ident=0x55555590a308) at /var/src/roxen/81pike/src/program.c:2249 2249 id = really_low_find_shared_string_identifier(ident, (gdb) l 2244 /* Specified inherit. */ 2245 id = low_reference_inherited_identifier(inherit_state, inh, ident, 2246 SEE_PROTECTED); 2247 } else { 2248 /* this_program:: (0), local:: (-1) or global:: (-2). */ 2249 id = really_low_find_shared_string_identifier(ident, 2250 inherit_state->new_program, 2251 SEE_PROTECTED|SEE_PRIVATE); 2252 } 2253 (gdb) p inh $2 = 0 (gdb) l 2230 2225 if (id == -1) continue; 2226 if (inherit_depth) { 2227 n = mkexternalnode(inherit_state->new_program, id); 2228 } else { 2229 n = mkidentifiernode(id); 2230 } 2231 if (res) { 2232 res = mknode(F_ARG_LIST, res, n); 2233 } else { 2234 res = n; (gdb) l 2235 } 2236 } 2237 if (res) { 2238 if (res->token == F_ARG_LIST) res = mkefuncallnode("aggregate", res); 2239 return res; 2240 } 2241 inh = -1; 2242 } else { 2243 if (inh > 0) { 2244 /* Specified inherit. */ (gdb) l 2245 id = low_reference_inherited_identifier(inherit_state, inh, ident, 2246 SEE_PROTECTED); 2247 } else { 2248 /* this_program:: (0), local:: (-1) or global:: (-2). */ 2249 id = really_low_find_shared_string_identifier(ident, 2250 inherit_state->new_program, 2251 SEE_PROTECTED|SEE_PRIVATE); 2252 } 2253 2254 if (id != -1) { (gdb)