public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* Bug: MAXACTION errors + try/catch would lead to wrong src loc.
@ 2020-05-24 16:29 Torsten Polle
  0 siblings, 0 replies; only message in thread
From: Torsten Polle @ 2020-05-24 16:29 UTC (permalink / raw)
  To: systemtap

[-- 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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-05-24 16:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-24 16:29 Bug: MAXACTION errors + try/catch would lead to wrong src loc Torsten Polle

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).