tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Tinycc-devel] VLA implementation


From: Edmund Grimley Evans
Subject: [Tinycc-devel] VLA implementation
Date: Thu, 5 Nov 2015 22:25:05 +0000
User-agent: Mutt/1.5.21 (2010-09-15)

I haven't looked at it very carefully, but it seems to me that the way
VLAs are currently implemented in TCC is not compatible with signal
handlers, or anything else that might use the stack asynchronously.

For example, when goto is translated, if there are VLAs in scope then
gen_vla_sp_restore(vla_sp_root_loc) is called, which generates code to
move the SP back to where it was at the start of the function body. At
the target location, where the label is, if any VLAs are in scope at
that location code generated by gen_vla_sp_restore(vla_sp_loc)
advances the SP again. If a signal were to arrive between the two SP
moves then the signal handler might overwrite live data on the stack.

In fact, this problem was detected by Valgrind without any signals.

Is this worth fixing? Or just document it as a limitation?

Does TCC's implementation of VLAs have any other known limitations?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]