From 5e604a6f39ef8e8086702d41113ea78856804c99 Mon Sep 17 00:00:00 2001 From: Tim Foley Date: Fri, 11 May 2018 13:56:14 -0700 Subject: 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 --- source/slang/parameter-binding.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/slang/parameter-binding.cpp') 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); -- cgit v1.2.3