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. */) ...@@ -524,15 +524,19 @@ If the third argument is incorrect, Emacs may crash. */)
} }
case Bgotoifnil: case Bgotoifnil:
MAYBE_GC (); {
op = FETCH2; Lisp_Object v1;
if (NILP (POP)) MAYBE_GC ();
{ op = FETCH2;
BYTE_CODE_QUIT; v1 = POP;
CHECK_RANGE (op); if (NILP (v1))
stack.pc = stack.byte_string_start + op; {
} BYTE_CODE_QUIT;
break; CHECK_RANGE (op);
stack.pc = stack.byte_string_start + op;
}
break;
}
case Bcar: case Bcar:
{ {
...@@ -730,15 +734,19 @@ If the third argument is incorrect, Emacs may crash. */) ...@@ -730,15 +734,19 @@ If the third argument is incorrect, Emacs may crash. */)
break; break;
case Bgotoifnonnil: case Bgotoifnonnil:
MAYBE_GC (); {
op = FETCH2; Lisp_Object v1;
if (!NILP (POP)) MAYBE_GC ();
{ op = FETCH2;
BYTE_CODE_QUIT; v1 = POP;
CHECK_RANGE (op); if (!NILP (v1))
stack.pc = stack.byte_string_start + op; {
} BYTE_CODE_QUIT;
break; CHECK_RANGE (op);
stack.pc = stack.byte_string_start + op;
}
break;
}
case Bgotoifnilelsepop: case Bgotoifnilelsepop:
MAYBE_GC (); MAYBE_GC ();
...@@ -771,24 +779,32 @@ If the third argument is incorrect, Emacs may crash. */) ...@@ -771,24 +779,32 @@ If the third argument is incorrect, Emacs may crash. */)
break; break;
case BRgotoifnil: case BRgotoifnil:
MAYBE_GC (); {
if (NILP (POP)) Lisp_Object v1;
{ MAYBE_GC ();
BYTE_CODE_QUIT; v1 = POP;
stack.pc += (int) *stack.pc - 128; if (NILP (v1))
} {
stack.pc++; BYTE_CODE_QUIT;
break; stack.pc += (int) *stack.pc - 128;
}
stack.pc++;
break;
}
case BRgotoifnonnil: case BRgotoifnonnil:
MAYBE_GC (); {
if (!NILP (POP)) Lisp_Object v1;
{ MAYBE_GC ();
BYTE_CODE_QUIT; v1 = POP;
stack.pc += (int) *stack.pc - 128; if (!NILP (v1))
} {
stack.pc++; BYTE_CODE_QUIT;
break; stack.pc += (int) *stack.pc - 128;
}
stack.pc++;
break;
}
case BRgotoifnilelsepop: case BRgotoifnilelsepop:
MAYBE_GC (); 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