[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] Fwd: TCC VLA bug?

From: Herman ten Brugge
Subject: Re: [Tinycc-devel] Fwd: TCC VLA bug?
Date: Sun, 5 Dec 2021 15:09:40 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.0

On 12/1/21 15:18, grischka wrote:
Got this report on private email.  Not sure what it means ...

Output of the code below if compiled with TCC is pretty messy:
array values are "misplaced" and overwrite each other.
But everything's ok if compiled with GCC.

The patch below seems to fix it. Can I push it?


diff --git a/tccgen.c b/tccgen.c
index e0b5fd6..67e205b 100644
--- a/tccgen.c
+++ b/tccgen.c
@@ -3494,7 +3494,7 @@ redo:
            type1 = vtop[-1].type;
-            if (vtop[-1].type.t & VT_VLA)
+            if (vtop[-1].type.ref->type.t & VT_VLA)
            else {
                u = pointed_size(&vtop[-1].type);

reply via email to

[Prev in Thread] Current Thread [Next in Thread]