Descriptionsandbox/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
Committed: https://crrev.com/50d2354a72b13ce2aed09af1879d37110c1454f5
Cr-Commit-Position: refs/heads/master@{#347838}
Patch Set 1 #Patch Set 2 : Add explanatory comment per offline feedback from jln #Messages
Total messages: 10 (4 generated)
|