summaryrefslogtreecommitdiff
path: root/ldo.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1998-01-28 15:47:05 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1998-01-28 15:47:05 -0200
commit46968b8ffa232a642cdc2f77cb02c7aa61ab9b89 (patch)
tree6538d169b364baa4e3735a85bf9bf5ccd84ff65b /ldo.c
parent6cdf0d8768afb16faaf6c020d6798a4588be2f74 (diff)
downloadlua-github-46968b8ffa232a642cdc2f77cb02c7aa61ab9b89.tar.gz
"volatile is the only reliable way to ensure that a local variable
retains the value it had at the time of the call to longjmp"
Diffstat (limited to 'ldo.c')
-rw-r--r--ldo.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/ldo.c b/ldo.c
index 76f3af98..08312511 100644
--- a/ldo.c
+++ b/ldo.c
@@ -1,5 +1,5 @@
/*
-** $Id: ldo.c,v 1.21 1998/01/07 16:26:48 roberto Exp roberto $
+** $Id: ldo.c,v 1.22 1998/01/27 21:21:27 roberto Exp roberto $
** Stack and Call structure of Lua
** See Copyright Notice in lua.h
*/
@@ -288,8 +288,8 @@ int luaD_protectedrun (int nResults)
{
jmp_buf myErrorJmp;
int status;
- struct C_Lua_Stack oldCLS = L->Cstack;
- jmp_buf *oldErr = L->errorJmp;
+ volatile struct C_Lua_Stack oldCLS = L->Cstack;
+ jmp_buf *volatile oldErr = L->errorJmp;
L->errorJmp = &myErrorJmp;
if (setjmp(myErrorJmp) == 0) {
do_callinc(nResults);
@@ -310,10 +310,10 @@ int luaD_protectedrun (int nResults)
*/
static int protectedparser (ZIO *z, int bin)
{
- int status;
- TProtoFunc *tf;
+ volatile int status;
+ TProtoFunc *volatile tf;
jmp_buf myErrorJmp;
- jmp_buf *oldErr = L->errorJmp;
+ jmp_buf *volatile oldErr = L->errorJmp;
L->errorJmp = &myErrorJmp;
if (setjmp(myErrorJmp) == 0) {
tf = bin ? luaU_undump1(z) : luaY_parser(z);