DirectXShaderCompiler icon indicating copy to clipboard operation
DirectXShaderCompiler copied to clipboard

unsigned int{16,32,64}_t at global scope causes Segfault (attempted to read from 0x8)

Open siliconvoodoo opened this issue 3 years ago • 4 comments

unsigned int16_t g;

result

Internal compiler error: access violation. Attempted to read from address 0x0000000000000008

Qualifiers (static, extern...) don't change the observable behavior. Fun fact: use a matrix/vector expansion (uint16_t1x1) and it doesn't crash anymore

siliconvoodoo avatar Sep 14 '22 02:09 siliconvoodoo

Well, that's unfortunate. 😣

Just in case you're unaware, the expected way to get an unsigned 16-bit integer is to use uint16_t which worked when I tried it. Obviously we shouldn't crash with this usage, but just in case this is blocking you I hope that helps.

pow2clk avatar Sep 19 '22 20:09 pow2clk

Thanks. It's ok it doesn't block me, I'm just here to be your nemesis :p

siliconvoodoo avatar Sep 20 '22 01:09 siliconvoodoo

I ran across this issue myself recently. There's something gnarly about how 16-bit type aliases are handled:

https://godbolt.org/z/M4TfanMfr

llvm-beanz avatar Nov 16 '23 16:11 llvm-beanz