o3de / o3de-azslc

Amazon Shader Language (AZSL) Compiler
Other
23 stars 14 forks source link

fix a runtime error in function semantic registration #80

Closed siliconvoodoo closed 1 year ago

siliconvoodoo commented 1 year ago

While investigating if https://github.com/o3de/o3de-azslc/issues/37 was really fixed, I stumbled uppon remaining issues. The fix of december https://github.com/o3de/o3de-azslc/commit/0c4eccd90108f6283a813f996e24acb4f6635364 definitely fixed a crash, but it wasn't investigated further after that. In fact in unlocked the door to at least 2 scenarios that don't finish compilation in a normal manner (fatal internal). I added 2 tests to make sure we don't regress on those 2. And the simplest fix I could find, in the form of a mini 3 state automata in the function symbol info.

before: case 1: image (no code output on stdout since fatal error interrupted) case 2: image (no code output, only stderr ODR message)

after: image Same for both 2 cases.