Update operator exception handling.

This commit is contained in:
2022-11-06 12:12:51 +08:00
parent 01a4214265
commit d58e255b3f

View File

@@ -47,7 +47,10 @@ namespace Cryville.Common.Pdt {
internal void Call(byte* prmem, bool noset) {
_prmem = prmem;
_rfreq = false;
try { Execute(); } catch (Exception) { _failure = true; }
try { Execute(); } catch (Exception ex) {
if (_rfreq) _etor.DiscardStack();
throw new InvalidOperationException("Evaluation failed", ex);
}
if (_failure) {
if (_rfreq) _etor.DiscardStack();
throw new InvalidOperationException("Evaluation failed");