From b8286c729acd634d042c1f7418df423e9cf80014 Mon Sep 17 00:00:00 2001 From: Jonas Maebe Date: Sat, 20 Aug 2011 08:24:34 +0000 Subject: [PATCH] * always write constant values as signed values, since the JVM does not support unsigned values (and Jasmin therefore extends them to the next larger size if they become too big) git-svn-id: branches/jvmbackend@18686 - --- compiler/agjasmin.pas | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/compiler/agjasmin.pas b/compiler/agjasmin.pas index 2c9fdbde84..adae09d4fb 100644 --- a/compiler/agjasmin.pas +++ b/compiler/agjasmin.pas @@ -735,8 +735,13 @@ implementation case csym.consttyp of constord: { always interpret as signed value, because the JVM does not - support unsigned 64 bit values } - result:=tostr(csym.value.valueord.svalue); + support unsigned values } + case csym.constdef.size of + 1:result:=tostr(shortint(csym.value.valueord.svalue)); + 2:result:=tostr(smallint(csym.value.valueord.svalue)); + 4:result:=tostr(longint(csym.value.valueord.svalue)); + 8:result:=tostr(csym.value.valueord.svalue); + end; conststring: result:=constastr(pchar(csym.value.valueptr),csym.value.len); constreal: