diff options
| author | Tim Foley <tfoleyNV@users.noreply.github.com> | 2018-02-26 14:02:29 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-02-26 14:02:29 -0800 |
| commit | c3bc49624891d9799975ae4a47e598961eea8aab (patch) | |
| tree | 78a2f1d4974e6ef5fabab8d15c18946d7738303d /tests/diagnostics | |
| parent | 28887ae858450e8a5efc8d43851fd8e5b5356e32 (diff) | |
Merge from 0.9.x (#429)
* Fix bug when subscripting a type that must be split (#396)
The logic was creating a `PairPseudoExpr` as part of a subscript (`operator[]`) operation, but neglecting to fill in its `pairInfo` field, which led to a null-pointer crash further along.
* Allow writes to UAV textures (#416)
Work on #415
This issue is already fixed in the `v0.10.*` line, but I'm back-porting the fix to `v0.9.*`.
The issue here was that the stdlib declarations for texture types were only including the `get` accessor for subscript operations, even if the texture was write-able.
I've also included the fixes for other subscript accessors in the stdlib (notably that `OutputPatch<T>` is readable, but not writable, despite what the name seems to imply).
* Fix infinite loop in semantic parsing (#424)
The code for parsing semantics was looking for a fixed set of tokens to terminate a semantic list, rather than assuming that whenever you don't see a `:` ahead, you probably are done with semantics. This meant that you could get into an infinite loop just with simple mistakes like leaving out a `;`.
This change fixes the parser to note infinite loop in this case, and adds a test case to verify the fix.
Diffstat (limited to 'tests/diagnostics')
| -rw-r--r-- | tests/diagnostics/missing-semicolon-after-semantic.slang | 9 | ||||
| -rw-r--r-- | tests/diagnostics/missing-semicolon-after-semantic.slang.expected | 6 |
2 files changed, 15 insertions, 0 deletions
diff --git a/tests/diagnostics/missing-semicolon-after-semantic.slang b/tests/diagnostics/missing-semicolon-after-semantic.slang new file mode 100644 index 000000000..00fc3aa6c --- /dev/null +++ b/tests/diagnostics/missing-semicolon-after-semantic.slang @@ -0,0 +1,9 @@ +//TEST:SIMPLE: + +// Forgetting to put in the `;` after declaraing a variable/field +// with a semantic used to put the compiler into an infinite loop. + +struct Test +{ + float4 pos : SV_POSITION +}; diff --git a/tests/diagnostics/missing-semicolon-after-semantic.slang.expected b/tests/diagnostics/missing-semicolon-after-semantic.slang.expected new file mode 100644 index 000000000..ae82385d0 --- /dev/null +++ b/tests/diagnostics/missing-semicolon-after-semantic.slang.expected @@ -0,0 +1,6 @@ +result code = -1 +standard error = { +tests/diagnostics/missing-semicolon-after-semantic.slang(9): error 20001: unexpected '}', expected ';' +} +standard output = { +} |
