1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-09 21:40:33 +02:00

Avoid side effects in argument to SCM_I_INUM.

* libguile/vm-i-system.c (halt): Avoid side effects in argument to
  SCM_I_INUM.
This commit is contained in:
Mark H Weaver 2014-03-11 20:12:32 -04:00
parent 3b7601cb34
commit 19c0bd22a8

View file

@ -32,8 +32,11 @@ VM_DEFINE_INSTRUCTION (0, nop, "nop", 0, 0, 0)
VM_DEFINE_INSTRUCTION (1, halt, "halt", 0, 0, 0) VM_DEFINE_INSTRUCTION (1, halt, "halt", 0, 0, 0)
{ {
SCM ret; SCM ret;
SCM nvalues_scm;
nvalues = SCM_I_INUM (*sp--); nvalues_scm = *sp--; /* SCM_I_INUM may evaluate its argument
more than once. */
nvalues = SCM_I_INUM (nvalues_scm);
NULLSTACK (1); NULLSTACK (1);
if (nvalues == 1) if (nvalues == 1)