From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 34484 invoked by alias); 23 Sep 2017 22:17:19 -0000 Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org Received: (qmail 34442 invoked by uid 48); 23 Sep 2017 22:17:16 -0000 From: "serhei.public at gmail dot com" To: systemtap@sourceware.org Subject: [Bug translator/22193] New: Regex matching (=~) should be treated as a side-effecting operation Date: Sat, 23 Sep 2017 22:17:00 -0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: systemtap X-Bugzilla-Component: translator X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: serhei.public at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: systemtap at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2017-q3/txt/msg00231.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=3D22193 Bug ID: 22193 Summary: Regex matching (=3D~) 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" =3D~ "f(.)"; println(matched(1)); exit() }' WARNING: Eliding side-effect-free expression : string 'foo' at :1:15 source: probe begin { ... foo ... "foo" =3D~ "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] --=20 You are receiving this mail because: You are the assignee for the bug.