If and return/exit statements causing uninitialized_use warnings #4385
Labels
bug
This behavior is unintended and should be fixed.
core
Topics concerning the core segments of the compiler (frontend, midend, parser)
regression
Code that previously compiled correctly either no longer compiles or produces invalid results.
Compiling the following code:
Results in the following warning, which I believe is incorrect behaviour:
The warning persists if I replace exactly one
return
withexit
, but the warning disappears if I replace both. The warning also disappears if I use a constant as theif
statement condition (e.g.if (true) return;
), this is why I used thosestandard_metadata
related checks in the sample above.p4c version:
1.2.4.2
These warnings were not present in the last p4c version I used, which I believe was
1.2.3.0
or1.2.2.0
.I attached the full source file for your convenience: switch.zip
The text was updated successfully, but these errors were encountered: