#1886: set_string_native() not implemented in class 'TclString'
----------------------+-----------------------------------------------------
Reporter: coke | Owner: whiteknight
Type: bug | Status: assigned
Priority: critical | Milestone:
Component: none | Version: master
Severity: fatal | Keywords:
Lang: tcl | Patch:
Platform: |
----------------------+-----------------------------------------------------
Comment(by whiteknight):
Okay, I've figured out what the problem is. I've created the
whiteknight/tt_1886 branch to fix it.
In the example, we're calling Parrot_pmc_reuse to convert a Float to a
TclString (which is an Object). However, that codepath has undefined
behavior. Parrot_pmc_reuse includes a comment suggesting that we should
not use it with Objects. Coming back from Parrot_pmc_reuse, the new
TclString PMC has a bad vtable structure. When we try to call
set_string_native, we go to the wrong vtable and throw the exception.
In the tt_1886 branch I'm going to refactor some of the instantiation
logic out of the Class PMC into src/oo.c. Then I'm going to use that logic
to implement the proper codepath in Parrot_pmc_reuse to handle the case of
morphing to an Object type.
--
Ticket URL: <https://trac.parrot.org/parrot/ticket/1886#comment:8>
Parrot <https://trac.parrot.org/parrot/>
Parrot Development
_______________________________________________
parrot-tickets mailing list
[email protected]
http://lists.parrot.org/mailman/listinfo/parrot-tickets