I wrote: > Indeed, Data::Clone does not protect against stack reallocation during > callbacks. I was implying that it should do PUSHSTACK/POPSTACK, but actually it should not have to, as XSUBs may reallocate the stack and pp_entersub already accounts for that. What seems to be the problem is that Data::Clone is not protecting itself. The code in question is: void clone(SV* sv) CODE: { ST(0) = sv_clone(sv); XSRETURN(1); } where sv_clone can reallocate the stack. That line translates into: PL_stack_base[ax + (0)] = Data_Clone_sv_clone( (sv)); Does the C standard guarantee any execution order here? (According to Perl execution order, that code would actually work. According to JavaScript execution order, it is completely broken.)Thread Previous | Thread Next