dawn-cmake/src
Antonio Maiorano 17e83de54f Fix UB when parsing HexFloat with large exponents
During HexFloat parsing, if exponent was too large, we would overflow
the signed integer being used to store its value. We now use an uint32_t
to avoid UB, then convert to int32_t when it's safe to do so.

Also error out if the input exponent is > INT_MAX - 127, which ensures
we will not wrap around and produce an invalid result when adding the
exponent bias of 127.

Bug: chromium:1240048
Bug: tint:1150
Change-Id: I1b57b2c965358b803ebb68ea70b76e759cdd3939
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/63120
Reviewed-by: David Neto <dneto@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
2021-09-03 19:40:36 +00:00
..
ast Allow array size to be a module-scope constant 2021-09-02 13:49:59 +00:00
diagnostic diag: Remove ICE bug report message 2021-08-04 20:19:28 +00:00
inspector Avoid i386 compile error related to comparison 2021-09-03 12:31:30 +00:00
reader Fix UB when parsing HexFloat with large exponents 2021-09-03 19:40:36 +00:00
resolver Allow array size to be a module-scope constant 2021-09-02 13:49:59 +00:00
sem Implement atomicSub intrinsic 2021-08-26 15:26:25 +00:00
transform Allow array size to be a module-scope constant 2021-09-02 13:49:59 +00:00
utils utils: Put temporary files in the tmp directory 2021-07-30 19:14:08 +00:00
val val: Remove source from validation result 2021-07-14 13:23:45 +00:00
writer Allow array size to be a module-scope constant 2021-09-02 13:49:59 +00:00
BUILD.gn reader/spirv: Handle the MatrixStride decoration 2021-07-27 08:17:29 +00:00
CMakeLists.txt Fix build when TINT_BUILD_[WGSL|SPV|MSL|HLSL]_[READER|WRITER] are toggled off 2021-09-03 14:16:56 +00:00
block_allocator.h Remove sem::AccessControl 2021-05-14 17:51:13 +00:00
block_allocator_test.cc Add tint::BlockAllocator<T> 2021-01-21 15:30:10 +00:00
castable.cc Pull Is() out of castable and into a new TypeInfo 2021-03-02 20:30:08 +00:00
castable.h castable: Infer Is() TO type from predicate 2021-08-23 15:16:42 +00:00
castable_test.cc castable: Infer Is() TO type from predicate 2021-08-23 15:16:42 +00:00
clone_context.cc Program: Track what transforms have been applied 2021-06-25 10:26:26 +00:00
clone_context.h transform/InlinePtrLets: Fix ICE for lets in for-loops 2021-07-15 22:20:29 +00:00
clone_context_test.cc CloneContext: Add an overload of Replace() that takes a function 2021-07-15 19:10:15 +00:00
debug.cc diag: Add System enumerator to all diagnostics 2021-06-24 11:27:36 +00:00
debug.h debug: Include system in assert string 2021-07-14 18:42:02 +00:00
debug_test.cc diag: Add System enumerator to all diagnostics 2021-06-24 11:27:36 +00:00
demangler.cc Validate that Symbols are all part of the same program 2021-04-15 18:20:03 +00:00
demangler.h Simplify calls to ast::Node::[to_]str() 2021-01-29 11:22:40 +00:00
demangler_test.cc Validate that Symbols are all part of the same program 2021-04-15 18:20:03 +00:00
intrinsic_table.cc castable: Infer Is() TO type from predicate 2021-08-23 15:16:42 +00:00
intrinsic_table.h IntrinsicTable: De-duplicate returned Intrinsics 2021-07-15 20:34:21 +00:00
intrinsic_table.inl Implement atomicSub intrinsic 2021-08-26 15:26:25 +00:00
intrinsic_table.inl.tmpl intrinsics: Add new struct form of modf(), frexp() 2021-07-23 16:43:01 +00:00
intrinsic_table_test.cc Implement texture_depth_multisampled_2d 2021-07-26 22:19:48 +00:00
intrinsics.def Implement atomicSub intrinsic 2021-08-26 15:26:25 +00:00
program.cc Reuse moved-from tint::Program variables 2021-08-11 13:50:24 +00:00
program.h transform: Add a debug flag to dump WGSL 2021-07-15 20:24:38 +00:00
program_builder.cc validation: compute shader must include 'workgroup_size' in its attributes 2021-06-29 18:39:44 +00:00
program_builder.h Allow array size to be a module-scope constant 2021-09-02 13:49:59 +00:00
program_builder_test.cc Remove typ::TypePair. 2021-05-20 15:10:48 +00:00
program_id.cc Add ProgramID feed it into all ast::Nodes 2021-04-13 23:27:27 +00:00
program_id.h diag: Add System enumerator to all diagnostics 2021-06-24 11:27:36 +00:00
program_test.cc Reuse moved-from tint::Program variables 2021-08-11 13:50:24 +00:00
scope_stack.h Add std::hash<tint::Symbol> specialization 2021-01-11 22:02:42 +00:00
scope_stack_test.cc Validate that Symbols are all part of the same program 2021-04-15 18:20:03 +00:00
source.cc Resolver: Check that every AST node is reached once 2021-04-19 19:16:12 +00:00
source.h wgsl parser: use new TypesBuilder factory functions, and set Source for ast::Type nodes 2021-04-27 17:32:37 +00:00
symbol.cc symbol: Add operator<() 2021-07-29 19:55:35 +00:00
symbol.h symbol: Add operator<() 2021-07-29 19:55:35 +00:00
symbol_table.cc Fix TextGenerator::UniqueIdentifier() failing with empty string arg 2021-06-29 22:07:05 +00:00
symbol_table.h Fix TextGenerator::UniqueIdentifier() failing with empty string arg 2021-06-29 22:07:05 +00:00
symbol_table_test.cc Fix TextGenerator::UniqueIdentifier() failing with empty string arg 2021-06-29 22:07:05 +00:00
symbol_test.cc Validate that Symbols are all part of the same program 2021-04-15 18:20:03 +00:00
test_main.cc Fix build when TINT_BUILD_[WGSL|SPV|MSL|HLSL]_[READER|WRITER] are toggled off 2021-09-03 14:16:56 +00:00
traits.h Validate function call arguments 2021-06-09 20:17:59 +00:00
traits_test.cc Remove all unnecessary includes 2021-03-09 11:11:17 +00:00