• Tobias Tebbi's avatar
    [torque] disallow using logical operators in value contexts · e569438b
    Tobias Tebbi authored
    This CL makes sure, that logical operators (||, &&) always have return
    type never. Together with a check that never is never passed as a
    function argument, this prevents faulty evaluation as in !(x || y).
    
    Before, the logical operators had a behavior similar to
    (bool labels Taken, NotTaken), with a fast exit if the left-hand side
    allowed shor-circuit evaluation, but returning the right-hand side
    otherwise. Since we want to allow existing (a || b || c) patterns in
    the codebase, this requires weakening the restriction that the left-
    and right-hand side need to have the same type. Now the possibilites
    are:
    bool, never
    never, bool
    never, never
    bool, bool
    constexpr bool, constexpr bool
    
    Bug: v8:8137
    Change-Id: I9576b337dc4008ac58b4625e77fef4e73bcdd6e3
    Reviewed-on: https://chromium-review.googlesource.com/1215162Reviewed-by: 's avatarDaniel Clifford <danno@chromium.org>
    Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#55750}
    e569438b
Name
Last commit
Last update
benchmarks Loading commit data...
build_overrides Loading commit data...
custom_deps Loading commit data...
docs Loading commit data...
gni Loading commit data...
include Loading commit data...
infra Loading commit data...
samples Loading commit data...
src Loading commit data...
test Loading commit data...
testing Loading commit data...
third_party Loading commit data...
tools Loading commit data...
.clang-format Loading commit data...
.editorconfig Loading commit data...
.git-blame-ignore-revs Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.gn Loading commit data...
.vpython Loading commit data...
.ycm_extra_conf.py Loading commit data...
AUTHORS Loading commit data...
BUILD.gn Loading commit data...
CODE_OF_CONDUCT.md Loading commit data...
ChangeLog Loading commit data...
DEPS Loading commit data...
LICENSE Loading commit data...
LICENSE.fdlibm Loading commit data...
LICENSE.strongtalk Loading commit data...
LICENSE.v8 Loading commit data...
LICENSE.valgrind Loading commit data...
OWNERS Loading commit data...
PRESUBMIT.py Loading commit data...
README.md Loading commit data...
WATCHLISTS Loading commit data...
codereview.settings Loading commit data...
snapshot_toolchain.gni Loading commit data...