Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Lucke <jacques@blender.org>2021-09-27 00:27:57 +0300
committerJacques Lucke <jacques@blender.org>2021-09-27 00:28:14 +0300
commitd046a1f2fa46eb14b45bfe696a3e2ad08c5110c0 (patch)
tree56a719fc548c95786c0e29ec039d1d5f2aca3a6e /source/blender/functions/intern
parent1cd8a438bb59d0e9e5160e8c91f9c937aab8195f (diff)
Functions: fail early when multi-function throws an exception
Multi-functions are not allowed to throw exceptions that are not caught in the same multi-function. Previously, it was difficult to backtrack a crash to a previously thrown exception.
Diffstat (limited to 'source/blender/functions/intern')
-rw-r--r--source/blender/functions/intern/multi_function_procedure_executor.cc16
1 files changed, 14 insertions, 2 deletions
diff --git a/source/blender/functions/intern/multi_function_procedure_executor.cc b/source/blender/functions/intern/multi_function_procedure_executor.cc
index b97282accdd..6d2d121bafd 100644
--- a/source/blender/functions/intern/multi_function_procedure_executor.cc
+++ b/source/blender/functions/intern/multi_function_procedure_executor.cc
@@ -1022,7 +1022,13 @@ static void execute_call_instruction(const MFCallInstruction &instruction,
}
}
- fn.call(IndexRange(1), params, context);
+ try {
+ fn.call(IndexRange(1), params, context);
+ }
+ catch (...) {
+ /* Multi-functions must not throw exceptions. */
+ BLI_assert_unreachable();
+ }
}
else {
MFParamsBuilder params(fn, &mask);
@@ -1038,7 +1044,13 @@ static void execute_call_instruction(const MFCallInstruction &instruction,
}
}
- fn.call(mask, params, context);
+ try {
+ fn.call(mask, params, context);
+ }
+ catch (...) {
+ /* Multi-functions must not throw exceptions. */
+ BLI_assert_unreachable();
+ }
}
}