summaryrefslogtreecommitdiffstats
path: root/source/slang/parameter-binding.cpp
diff options
context:
space:
mode:
authorTim Foley <tfoleyNV@users.noreply.github.com>2018-05-11 13:56:14 -0700
committerGitHub <noreply@github.com>2018-05-11 13:56:14 -0700
commit5e604a6f39ef8e8086702d41113ea78856804c99 (patch)
tree035a4de9b84bdc04f377344dcaea931aa1896fa4 /source/slang/parameter-binding.cpp
parent10c0ffa7de111bd2c0096015bba5ca2110d03bc1 (diff)
Cleanups around behavior when the compiler fails (#553)
* Cleanups around behavior when the compiler fails * Add another case where we try to `noteInternalErrorLoc()` if an exception in thrown. This one is the in the logic for emitting an IR instruciton. This could be improved by adding another layer at the function level (as a catch-all for instructions with no location), but something is better than nothing. * Change a bunch of `assert()`s over to `SLANG_ASSERT()`s, so that we can theoretically take more control over them (e.g., make release builds with asserts enabled) * Some other small cleanups around the assertions we perform. In the survey I made, I didn't really see many obvious "smoking gun" cases where we could produce a significantly better error message for some of the unimplemented/unexpected paths, other than to actually implement the missing functionality. * fixup
Diffstat (limited to 'source/slang/parameter-binding.cpp')
-rw-r--r--source/slang/parameter-binding.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/slang/parameter-binding.cpp b/source/slang/parameter-binding.cpp
index e0cc26f2b..e5fddac02 100644
--- a/source/slang/parameter-binding.cpp
+++ b/source/slang/parameter-binding.cpp
@@ -447,7 +447,7 @@ static void diagnoseParameterTypeMismatch(
ParameterBindingContext* context,
StructuralTypeMatchStack* inStack)
{
- assert(inStack);
+ SLANG_ASSERT(inStack);
// The bottom-most entry in the stack should represent
// the shader parameters that kicked things off
@@ -466,7 +466,7 @@ static void diagnoseTypeMismatch(
StructuralTypeMatchStack* inStack)
{
auto stack = inStack;
- assert(stack);
+ SLANG_ASSERT(stack);
diagnoseParameterTypeMismatch(context, stack);
auto leftType = GetType(stack->leftDecl);