Commit 21ed6de3 authored by Ken Raeburn's avatar Ken Raeburn
Browse files

(Fbyte_code): Avoid dangerous side effects in NILP argument.

parent 09706e1f
......@@ -524,15 +524,19 @@ If the third argument is incorrect, Emacs may crash. */)
}
case Bgotoifnil:
{
Lisp_Object v1;
MAYBE_GC ();
op = FETCH2;
if (NILP (POP))
v1 = POP;
if (NILP (v1))
{
BYTE_CODE_QUIT;
CHECK_RANGE (op);
stack.pc = stack.byte_string_start + op;
}
break;
}
case Bcar:
{
......@@ -730,15 +734,19 @@ If the third argument is incorrect, Emacs may crash. */)
break;
case Bgotoifnonnil:
{
Lisp_Object v1;
MAYBE_GC ();
op = FETCH2;
if (!NILP (POP))
v1 = POP;
if (!NILP (v1))
{
BYTE_CODE_QUIT;
CHECK_RANGE (op);
stack.pc = stack.byte_string_start + op;
}
break;
}
case Bgotoifnilelsepop:
MAYBE_GC ();
......@@ -771,24 +779,32 @@ If the third argument is incorrect, Emacs may crash. */)
break;
case BRgotoifnil:
{
Lisp_Object v1;
MAYBE_GC ();
if (NILP (POP))
v1 = POP;
if (NILP (v1))
{
BYTE_CODE_QUIT;
stack.pc += (int) *stack.pc - 128;
}
stack.pc++;
break;
}
case BRgotoifnonnil:
{
Lisp_Object v1;
MAYBE_GC ();
if (!NILP (POP))
v1 = POP;
if (!NILP (v1))
{
BYTE_CODE_QUIT;
stack.pc += (int) *stack.pc - 128;
}
stack.pc++;
break;
}
case BRgotoifnilelsepop:
MAYBE_GC ();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment