This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
[Bug translator/22193] New: Regex matching (=~) should be treated as a side-effecting operation
- From: "serhei.public at gmail dot com" <sourceware-bugzilla at sourceware dot org>
- To: systemtap at sourceware dot org
- Date: Sat, 23 Sep 2017 22:17:14 +0000
- Subject: [Bug translator/22193] New: Regex matching (=~) should be treated as a side-effecting operation
- Auto-submitted: auto-generated
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.