[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Side effect order in set*value macros
- From: Roberto Ierusalimschy <roberto@...>
- Date: Mon, 12 Oct 2015 11:15:06 -0300
> > I don't think the stack may get reallocated during the execution of
> > 'lua_makeMeAStringPlease'. What call sequence would cause that?
> I must admit I'm using eLua, which includes some well-known patches as e.g.
> the emergency GC patch, the NaN value packing patch and others. My minimal
> test case includes requiring a module which itself requires an (empty)
> module (I've checked that this leaves some garbage on the stack), and then
> trying something that constructs a string, like print, tostring(), etc. I
> understand this may be an eLua issue; I'm just interested in how it should
> better be solved (save/restorestack? explicit temporary variable?).
For me, the obvious solution is a temporary variable to hold the string
(and therefore impose an order of first creating the string and then
getting the stack address). But official Lua does not seem to have
this particular issue.