From 22b562d1a47443f266b114b4b207bcdd4eb3c54f Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Mon, 19 Apr 2021 12:13:35 -0400 Subject: Infinite generic parsing bug fix (#1799) * #include an absolute path didn't work - because paths were taken to always be relative. * Fix bug causing infinite loop in parser. * Add a faster path for LookAheadToken when the offset is 0. * Fix typo introduced in last commit. --- tests/bugs/eroneous-generic-parse.slang | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 tests/bugs/eroneous-generic-parse.slang (limited to 'tests/bugs/eroneous-generic-parse.slang') diff --git a/tests/bugs/eroneous-generic-parse.slang b/tests/bugs/eroneous-generic-parse.slang new file mode 100644 index 000000000..80a693456 --- /dev/null +++ b/tests/bugs/eroneous-generic-parse.slang @@ -0,0 +1,15 @@ +//DIAGNOSTIC_TEST:SIMPLE: -target hlsl -entry computeMain -stage compute + +//TEST_INPUT:ubuffer(data=[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0], stride=16):out +RWStructuredBuffer outputBuffer; + +// Previously this definition would lead to an infinite loop in parsing. +int doThing<1>() { return 2; } + +[numthreads(4, 4, 1)] +void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID) +{ + int index = dispatchThreadID.x; + + outputBuffer[index] = index; +} \ No newline at end of file -- cgit v1.2.3