summaryrefslogtreecommitdiff
path: root/src/bytecode.c
diff options
context:
space:
mode:
authorKen Raeburn <raeburn@raeburn.org>2005-12-06 07:39:05 +0000
committerKen Raeburn <raeburn@raeburn.org>2005-12-06 07:39:05 +0000
commit34f0dc39d61566381dac2b9db555266e54c3d77a (patch)
treeb2a334694b7eae8e1acac6e4c38a61514bf0a69a /src/bytecode.c
parentf6b9d72ef686664792c79b83a094fc6a61d7f9e0 (diff)
downloademacs-34f0dc39d61566381dac2b9db555266e54c3d77a.tar.gz
(Fbyte_code): Avoid dangerous side effects in NILP argument.
Diffstat (limited to 'src/bytecode.c')
-rw-r--r--src/bytecode.c84
1 files changed, 50 insertions, 34 deletions
diff --git a/src/bytecode.c b/src/bytecode.c
index e23d835cf10..af09061dbc3 100644
--- a/src/bytecode.c
+++ b/src/bytecode.c
@@ -524,15 +524,19 @@ If the third argument is incorrect, Emacs may crash. */)
}
case Bgotoifnil:
- MAYBE_GC ();
- op = FETCH2;
- if (NILP (POP))
- {
- BYTE_CODE_QUIT;
- CHECK_RANGE (op);
- stack.pc = stack.byte_string_start + op;
- }
- break;
+ {
+ Lisp_Object v1;
+ MAYBE_GC ();
+ op = FETCH2;
+ 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:
- MAYBE_GC ();
- op = FETCH2;
- if (!NILP (POP))
- {
- BYTE_CODE_QUIT;
- CHECK_RANGE (op);
- stack.pc = stack.byte_string_start + op;
- }
- break;
+ {
+ Lisp_Object v1;
+ MAYBE_GC ();
+ op = FETCH2;
+ 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:
- MAYBE_GC ();
- if (NILP (POP))
- {
- BYTE_CODE_QUIT;
- stack.pc += (int) *stack.pc - 128;
- }
- stack.pc++;
- break;
+ {
+ Lisp_Object v1;
+ MAYBE_GC ();
+ v1 = POP;
+ if (NILP (v1))
+ {
+ BYTE_CODE_QUIT;
+ stack.pc += (int) *stack.pc - 128;
+ }
+ stack.pc++;
+ break;
+ }
case BRgotoifnonnil:
- MAYBE_GC ();
- if (!NILP (POP))
- {
- BYTE_CODE_QUIT;
- stack.pc += (int) *stack.pc - 128;
- }
- stack.pc++;
- break;
+ {
+ Lisp_Object v1;
+ MAYBE_GC ();
+ v1 = POP;
+ if (!NILP (v1))
+ {
+ BYTE_CODE_QUIT;
+ stack.pc += (int) *stack.pc - 128;
+ }
+ stack.pc++;
+ break;
+ }
case BRgotoifnilelsepop:
MAYBE_GC ();