From 8ce07d41df539b755f3a16f287537e474cfa9c86 Mon Sep 17 00:00:00 2001 From: Torsten Polle Date: Sun, 24 May 2020 13:27:31 +0200 Subject: [PATCH] Fix: Bug: MAXACTION errors + try/catch would lead to wrong src loc. The structure context c does not always contain the field actionremaining. If the argument --suppress_time_limits is given, the field is not declared. --- translate.cxx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/translate.cxx b/translate.cxx index f142667..3fe284b 100644 --- a/translate.cxx +++ b/translate.cxx @@ -3771,10 +3771,13 @@ void c_unparser::visit_try_block (try_block *s) o->newline() << "if (likely(c->last_error == NULL)) goto out;"; - // NB: MAXACTION errors are not catchable and we should never clear the error - // message below otherwise the source location in the message would - // become inaccurate (always being the top-level try/catch statement's). - o->newline() << "if (unlikely (c->actionremaining <= 0)) goto out;"; + if (!session->suppress_time_limits) + { + // NB: MAXACTION errors are not catchable and we should never clear the error + // message below otherwise the source location in the message would + // become inaccurate (always being the top-level try/catch statement's). + o->newline() << "if (unlikely (c->actionremaining <= 0)) goto out;"; + } if (s->catch_error_var) { -- 2.7.4