Open PappasBrent opened 2 months ago
This issue is still occurring for me if I wrap the name of the enum variable in parentheses at its declaration site:
enum FOO { BAR };
int main(void) {
int a[1] = { 0 };
enum FOO(b) = BAR;
return a[b];
}
VAST version
Ubuntu clang version 18.1.8 (++20240615103753+3b5b5c1ec4a3-1~exp1~20240615223858.136) Target: x86_64-pc-linux-gnu Thread model: posix
LLVM version
18.1.8
Operating system
Ubuntu 22.04.4 LTS x86_64
Description
The VAST codegen module verifier fails to verify subscript expressions when the index operand is an enum value. I receive the following error:
Steps to Reproduce
Create a file
test_subscript_enum_verify.c
with the following contents:Run
vast-front
on the file like so:Note that this issue only occurs if the enum value used for the index is declared using the
enum
keyword (i.e., its type is an elaborated type). This means that the following two similar programs do not raise errors: