From c9938cccfb001962d402e022c028fd2994513315 Mon Sep 17 00:00:00 2001 From: Christophe de Dinechin Date: Mon, 29 Mar 2021 09:06:51 +0200 Subject: [PATCH] bytecode: In Classify, move Release before changing type Release only works if it knows the actual type and has the right pointer Signed-off-by: Christophe de Dinechin --- include/bytecode.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/bytecode.h b/include/bytecode.h index c1b280813..1586bbfe3 100644 --- a/include/bytecode.h +++ b/include/bytecode.h @@ -445,6 +445,7 @@ MACHINE_TYPE(natural, unsigned long, naught) case NATURAL: { Natural *xn = (Natural *) tree; + Release(xn); if (xn->IsSigned()) { type = integer_mtype; @@ -455,20 +456,20 @@ MACHINE_TYPE(natural, unsigned long, naught) type = natural_mtype; as_natural = xn->value; } - Release(xn); return *this; } case REAL: { Real *xr = (Real *) tree; + Release(xr); type = real_mtype; as_real = xr->value; - Release(xr); return *this; } case TEXT: { Text *xt = (Text *) tree; + Release(xt); if (xt->IsCharacter()) { type = character_mtype; @@ -479,7 +480,6 @@ MACHINE_TYPE(natural, unsigned long, naught) type = text_mtype; as_text = new text(xt->value); } - Release(xt); return *this; } case NAME: