From fd04710c238454a8c9eaed8ad92bd6d71c4a7a9c Mon Sep 17 00:00:00 2001 From: Alexey Frunze Date: Mon, 21 Apr 2014 01:08:49 -0700 Subject: [PATCH] Fix initialization In the following typedef struct S0 { char ac[4]; } T1; int v26 = (int)&((T1*)0)->ac[3]; int v27 = &((T1*)0)->ac[3]; v27 should be initialized to 3 just as v26. --- src/cmd/smlrc/smlrc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmd/smlrc/smlrc.c b/src/cmd/smlrc/smlrc.c index 34a137f..b0f93d8 100644 --- a/src/cmd/smlrc/smlrc.c +++ b/src/cmd/smlrc/smlrc.c @@ -5805,7 +5805,7 @@ int InitScalar(int synPtr, int tok) { // TBD??? truncate values for types smaller than int (e.g. char and short), // so they are always in range? - GenIntData(elementSz, exprVal); + GenIntData(elementSz, stack[0][1]); } else if (elementSz == SizeOfWord + 0u && stack[sp - 1][0] == tokIdent) {