#1505: :anon vtable overrides don't work in PIR
--------------------+-------------------------------------------------------
 Reporter:  moritz  |       Owner:  whiteknight
     Type:  bug     |      Status:  new        
 Priority:  normal  |   Milestone:             
Component:  core    |     Version:  2.1.0      
 Severity:  medium  |    Keywords:             
     Lang:  perl6   |       Patch:             
 Platform:  linux   |  
--------------------+-------------------------------------------------------
Changes (by whiteknight):

  * owner:  => whiteknight


Comment:

 As a quick note, here's the codepath that these things should be taking in
 IMCC. I've been tracing it out a little and think I know what things are
 bad,but haven't had time for a fix. In my tests I removed the :method
 flag. The result is the same but fewer branches are taken in the code to
 reduce debugging time.

  - sub enters compilers/imcc/pbc.c:add_const_pmc_sub.
  - On line 1410, gets vtable_index of 76. I don't know if this number is
 correct, but seems plausible.
  - On line 1447 calls Parrot_store_sub_in_namespace. At this point, here
 is the sub PMC data according to GDB:
 {{{
 (gdb) p * sub
 $3 = {seg = 0x80f6580, start_offs = 6, end_offs = 13, HLL_id = 0,
 namespace_name = 0x80e7a68,
   namespace_stash = 0x0, name = 0x807f27c, method_name = 0x80c5cdc,
 ns_entry_name = 0x807f27c,
   subid = 0x807f27c, vtable_index = 76, multi_signature = 0x0, n_regs_used
 = {0, 0, 0, 1},
   lex_info = 0x0, outer_sub = 0x0, eval_pmc = 0x0, ctx = 0x0, comp_flags =
 0, arg_info = 0x0,
   outer_ctx = 0x0}
 }}}
  - Sub enters src/global.c:Parrot_store_sub_in_namespace.
  - On line 816, there is a test for the sub being anon. The vtable in
 question fails this test. On line 820, the sub would be passed to
 Parrot_store_global_n, which it looks like will perform the rest of the
 magic.

 So I think in that Parrot_store_sub_in_namespace function we need to add a
 condition where the sub can be :anon if it is also :vtable, and then
 continue in that direction. I will do testing tonight if nobody beats me
 to it.

-- 
Ticket URL: <https://trac.parrot.org/parrot/ticket/1505#comment:1>
Parrot <https://trac.parrot.org/parrot/>
Parrot Development
_______________________________________________
parrot-tickets mailing list
[email protected]
http://lists.parrot.org/mailman/listinfo/parrot-tickets

Reply via email to