Jens Rieks wrote:
>I've used PerlInt instead of PerlString by mistake.
>The error occurs if code like this is executed a few times:
>("data" is a PerlInt)
>
>        find_global P1, "data"
>       set S1, P1
># ....
>       set P1, S1
>
>It works a few thousend times, then it stops working
>often resulting in a crash.
>The code works like expected when
>- using PerlString instead of PerlInt or

The PerlInt set_string code currently tries to transform the PMC into a
PerlString, however it does not do a complete job. Specifically, it does not
set the flag PMC_is_buffer_ptr_FLAG, and therefore the string is not
traceable from the root set. This is easy to fix, but I believe (hope?) that
this whole transmogrification thing will change anyway. The reverse problem
also applies - if you create a PerlString, then set it to an integer, the
flag stays set; this could also cause unpredictable behaviour.

For now, just assume that any attempt to turn one type of PMC into another
is likely to have undesirable consequences, and you should be safe.

--
Peter Gibbs
EmKel Systems


Reply via email to