Open PappasBrent opened 5 days ago
A solution to this problem will need to handle arbitrarily nested anonymous tag types, e.g., this should be fine as well:
struct foo {
struct {
union {
struct {
int bar;
};
};
};
};
int main(void) {
(void) __builtin_offsetof(struct foo, bar);
return 0;
}
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
vast-front
crashes with the following stack trace when attempting to lower a program containing anoffset
expression where one of its components is a field of a nested anonymous tag type:Steps to Reproduce
Create a file
test_offsetof_anon_struct_field.c
with the following contents:Run
vast-front
on the file like so: