public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: Torsten Polle <Torsten.Polle@gmx.de>
To: systemtap@sourceware.org
Subject: Bug: MAXACTION errors + try/catch would lead to wrong src loc.
Date: Sun, 24 May 2020 18:29:22 +0200	[thread overview]
Message-ID: <95C43BAB-F370-4B96-A660-724103DA3691@gmx.de> (raw)

[-- Attachment #1: Type: text/plain, Size: 557 bytes --]

Hi,

When I pass the option --suppress-time-limits, I get a compile error. This error has been introduced by the commit "Bug: MAXACTION errors + try/catch would lead to wrong src loc." (91ffedd).

There is one other place in the code, where the access to the field ‚actionremaining‘ of 'struct context' is guarded. I added the guard that refers to the usage of the option --suppress-time-limits also to the newly introduced access to the field. But I’m not sure whether any of the other guards have to be added as well.

Kind Regards,
Torsten

[-- Attachment #2: Fix-Bug-MAXACTION-errors-try-catch-would-lead-to-wro.patch --]
[-- Type: application/octet-stream, Size: 1486 bytes --]

From 8ce07d41df539b755f3a16f287537e474cfa9c86 Mon Sep 17 00:00:00 2001
From: Torsten Polle <Torsten.Polle@gmx.de>
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


                 reply	other threads:[~2020-05-24 16:29 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=95C43BAB-F370-4B96-A660-724103DA3691@gmx.de \
    --to=torsten.polle@gmx.de \
    --cc=systemtap@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).