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.
This commit is contained in:
2021-09-26 23:27:57 +02:00
parent 1cd8a438bb
commit d046a1f2fa

View File

@@ -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();
}
}
}