public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [Bug translator/22193] New: Regex matching (=~) should be treated as a side-effecting operation
@ 2017-09-23 22:17 serhei.public at gmail dot com
  2018-03-23 16:23 ` [Bug translator/22193] " serhei.public at gmail dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: serhei.public at gmail dot com @ 2017-09-23 22:17 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=22193

            Bug ID: 22193
           Summary: Regex matching (=~) should be treated as a
                    side-effecting operation
           Product: systemtap
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: translator
          Assignee: systemtap at sourceware dot org
          Reporter: serhei.public at gmail dot com
  Target Milestone: ---

Now that the regex matching operator modifies context data structures
(CONTEXT->last_match), the translator should no longer elide a regex match as
side-effect-free if its return value is unused.

Currently what happens:

$ stap -e 'probe begin { "foo" =~ "f(.)"; println(matched(1)); exit() }'
WARNING: Eliding side-effect-free expression : string 'foo' at <input>:1:15
 source: probe begin {  ... foo ... "foo" =~ "f(.)"; println(matched(1));
exit() }
                            ^
ERROR: Attempted to get subexpression 1 from failed match near identifier
'matched' at /opt/systemtap/share/systemtap/tapset/regex.stp:36:10
WARNING: Number of errors: 1, skipped probes: 0
WARNING: /opt/systemtap/bin/staprun exited with status: 1
Pass 5: run failed.  [man error::pass5]

-- 
You are receiving this mail because:
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-06-15 17:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-23 22:17 [Bug translator/22193] New: Regex matching (=~) should be treated as a side-effecting operation serhei.public at gmail dot com
2018-03-23 16:23 ` [Bug translator/22193] " serhei.public at gmail dot com
2018-03-31 12:22 ` jeremip11 at gmail dot com
2018-04-17 20:07 ` serhei.public at gmail dot com
2018-06-15 17:06 ` mcermak at redhat dot com

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