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
  • common
  • mathutil.h
Find file
BlameHistoryPermalink
  • Alexis Hetu's avatar
    Fix undefined behavior in minifloat conversion · 36b884e6
    Alexis Hetu authored Sep 02, 2020
    This cl applies the same fix already applied in SwiftShader here:
    https://swiftshader-review.googlesource.com/c/SwiftShader/+/48069
    
    Original description:
    Shifting a 32-bit value by 32 or more is undefined behavior in C++. This
    previously happened in this code when converting a 32-bit float value to
    an 11- or 10-bit minifloat which is too small to be represented as a
    denormal, and should produce 0 instead.
    
    Instead of going through this arithmetic for denormals, just test
    whether the input value is too small to produce a valid denormal, and
    return 0 instead.
    
    Bug: chromium:1117433
    Change-Id: I227c0e4c53000df6d9260fee364351a300b113a2
    Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2391764Reviewed-by: 's avatarShahbaz Youssefi <syoussefi@chromium.org>
    Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org>
    Commit-Queue: Alexis Hétu <sugoi@chromium.org>
    36b884e6
mathutil.h 40.3 KB
EditWeb IDE
×

Replace mathutil.h

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.