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:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user