No, on the account that the string is still registered. A Lua string will be created at the start of the Lua state and that string will remain referenced within Lua and thus never garbage collected.
Other responses are suggesting that this is okay.
Yes, but that is not a guarantee that it will be invalid either. The point of my question was to determine what criteria would allow a guarantee to be made, either way.
What do you mean popping prematurely? A C function has to ensure the stack is balanced before returning, right? And that means popping before returning whatever was pushed during the function call. There is no way to directly grab a string value from Lua memory; you have to first push the string onto the stack then call lua_tostring() and as a consequence you then have to pop it back off before returning.
Chris Smith <email@example.com>