mirror of https://github.com/rusefi/lua.git
"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"
This commit is contained in:
parent
6cdf0d8768
commit
46968b8ffa
12
ldo.c
12
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
|
** Stack and Call structure of Lua
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
|
@ -288,8 +288,8 @@ int luaD_protectedrun (int nResults)
|
||||||
{
|
{
|
||||||
jmp_buf myErrorJmp;
|
jmp_buf myErrorJmp;
|
||||||
int status;
|
int status;
|
||||||
struct C_Lua_Stack oldCLS = L->Cstack;
|
volatile struct C_Lua_Stack oldCLS = L->Cstack;
|
||||||
jmp_buf *oldErr = L->errorJmp;
|
jmp_buf *volatile oldErr = L->errorJmp;
|
||||||
L->errorJmp = &myErrorJmp;
|
L->errorJmp = &myErrorJmp;
|
||||||
if (setjmp(myErrorJmp) == 0) {
|
if (setjmp(myErrorJmp) == 0) {
|
||||||
do_callinc(nResults);
|
do_callinc(nResults);
|
||||||
|
@ -310,10 +310,10 @@ int luaD_protectedrun (int nResults)
|
||||||
*/
|
*/
|
||||||
static int protectedparser (ZIO *z, int bin)
|
static int protectedparser (ZIO *z, int bin)
|
||||||
{
|
{
|
||||||
int status;
|
volatile int status;
|
||||||
TProtoFunc *tf;
|
TProtoFunc *volatile tf;
|
||||||
jmp_buf myErrorJmp;
|
jmp_buf myErrorJmp;
|
||||||
jmp_buf *oldErr = L->errorJmp;
|
jmp_buf *volatile oldErr = L->errorJmp;
|
||||||
L->errorJmp = &myErrorJmp;
|
L->errorJmp = &myErrorJmp;
|
||||||
if (setjmp(myErrorJmp) == 0) {
|
if (setjmp(myErrorJmp) == 0) {
|
||||||
tf = bin ? luaU_undump1(z) : luaY_parser(z);
|
tf = bin ? luaU_undump1(z) : luaY_parser(z);
|
||||||
|
|
Loading…
Reference in New Issue