Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
  • This project
    • Loading...
  • Sign in / Register
A
angle
  • Project
    • Overview
    • Details
    • Activity
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 0
    • Issues 0
    • List
    • Board
    • Labels
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Chen Yisong
  • angle
  • Repository

Switch branch/tag
  • angle
  • src
  • compiler
  • translator
  • ConstantUnion.cpp
Find file
BlameHistoryPermalink
  • Olli Etuaho's avatar
    Fix integer math overflows in the preprocessor · 7f9a55f7
    Olli Etuaho authored Oct 03, 2016
    Evaluating integer expressions in the ESSL preprocessor may result in
    overflowing the signed integer range. Implement wrapping overflow for
    preprocessor expressions in a way that doesn't hit any undefined
    behavior.  In the ESSL spec, preprocessor expressions are defined to
    have mostly the same semantics as in C++. Since C++ doesn't define
    what happens on signed integer overflow, we choose to make most of the
    operators wrap on overflow for backward compatibility and consistency
    with the rest of the ESSL spec.
    
    We reuse the existing wrapping overflow helpers that are
    used for constant folding. To be able to do this, the type used in the
    preprocessor expression parser is changed from 64-bit to 32-bit.
    
    Shifting negative numbers is implemented as a logical shift. This
    cannot be disallowed since dEQP requires shaders shifting negative
    numbers to pass compilation.
    
    Undefined bitwise shifts where the offset is greater than 31 will now
    result in a compile-time error.
    
    A couple of test cases are now covered by the preprocessor tests
    rather than full compilation tests. This isolates the tests better and
    they run faster.
    
    BUG=chromium:652223
    TEST=angle_unittests
    
    Change-Id: I84be40d404c10ecd0846c5d477e626a94a2a8587
    Reviewed-on: https://chromium-review.googlesource.com/392146
    Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
    Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
    7f9a55f7
ConstantUnion.cpp 15.9 KB
EditWeb IDE
×

Replace ConstantUnion.cpp

Attach a file by drag & drop or click to upload


Cancel
A new branch will be created in your fork and a new merge request will be started.