gpgscm: Avoid mutating integer.
authorJustus Winter <justus@g10code.com>
Thu, 6 Apr 2017 14:24:49 +0000 (16:24 +0200)
committerJustus Winter <justus@g10code.com>
Thu, 6 Apr 2017 14:24:49 +0000 (16:24 +0200)
* tests/gpgscm/scheme.c (opexe_5): Do not modify the integer in-place
while printing an vector.  Integer objects may be shared, so they must
not be mutated.

Signed-off-by: Justus Winter <justus@g10code.com>
tests/gpgscm/scheme.c

index 3719e53..aa0cf69 100644 (file)
@@ -5181,7 +5181,7 @@ static pointer opexe_5(scheme *sc, enum scheme_opcodes op) {
                s_return(sc,sc->T);
           } else {
                pointer elem=vector_elem(vec,i);
-               ivalue_unchecked(cdr(sc->args))=i+1;
+               cdr(sc->args) = mk_integer(sc, i + 1);
                s_save(sc,OP_PVECFROM, sc->args, sc->NIL);
                sc->args=elem;
                if (i > 0)