sandbox/linux/bpf_dsl: eliminate implicit dependency on C++ compiler behavior
commit50d2354a72b13ce2aed09af1879d37110c1454f5
authormdempsky <mdempsky@chromium.org>
Tue, 8 Sep 2015 23:53:30 +0000 (8 16:53 -0700)
committerCommit bot <commit-bot@chromium.org>
Tue, 8 Sep 2015 23:54:05 +0000 (8 23:54 +0000)
tree8ebbb6f5a0bd20d655a37712a978c29d8d1ffe21
parent02d09c5f8137a4ba1460e2c2a4400a8f128a75a5
sandbox/linux/bpf_dsl: eliminate implicit dependency on C++ compiler behavior

For the expression F(G(), H()), C++ does not guarantee whether G() or
H() will be evaluated first.  Apparently the system compiler on Chrome
OS makes a different decision than on Ubuntu, which causes the golden
file tests introduced by https://crrev.com/1306723002 (which were
generated on Ubuntu) to fail on Chrome OS.

Easy fix: rewrite the expression as

    g = G()
    h = H()
    F(g, h)

to avoid any compiler behavior dependency.

BUG=529480

Review URL: https://codereview.chromium.org/1327693005

Cr-Commit-Position: refs/heads/master@{#347838}
sandbox/linux/bpf_dsl/bpf_dsl.cc