Fix undertermined execution behavior (#4751)
Fix for the issue #4744: Ambiguous side-effect execution on vector_downward::make_space() method. C++ does not impose evaluation order on the two expressions on the right side of the assignment, so compiler can freely decide. As ensure_space() method can change the value of "cur_" variable, the result of the subtraction may be different depending on the evaluation order, which is ambiguous in C++. In order to make this code deterministic and correct, cur_ must be evaluated after ensure_space() is called.
Showing
Please
register
or
sign in
to comment