mc-imperial / dredd

Framework for evaluating C/C++ compiler testing tools
Apache License 2.0
11 stars 3 forks source link

Rewrite sizes of certain constant-sized arrays #273

Closed afd closed 1 month ago

afd commented 1 month ago

Avoids a problem where constant declarations that appear in the size expression for a constant-sized array might have their initialisers mutated, such that the size expression is no longer a compile time constant. This is a problem if the array is also initialized. The solution is to rewrite the size expressions of such arrays, replacing the original compile-time-constant expression with the value to which it evaluates. The constants that make up the expression - which may also be referred to elsewhere - can then have their initial values freely mutated.

Fixes #263.