This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug translator/22193] New: Regex matching (=~) should be treated as a side-effecting operation


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]