diff options
author | Michel Dänzer <[email protected]> | 2019-09-25 11:34:27 +0200 |
---|---|---|
committer | Michel Dänzer <[email protected]> | 2019-10-24 16:20:04 +0200 |
commit | 2b1b56cb3ae9672ad56930a10ea61f91905bc958 (patch) | |
tree | 40aeabd02c9cc0e5b94f7bedcbcd90db63263b2d /src/intel | |
parent | 41623be20ee615fc5d2133c34b17b38e7d00146c (diff) |
intel/fs: Check for NULL key in fs_visitor constructor
Flagged by UBSan:
../src/intel/compiler/brw_fs_visitor.cpp:986:20: runtime error: member access within null pointer of type 'const struct brw_base_prog_key'
#0 0x559fadb48556 in fs_visitor::init() ../src/intel/compiler/brw_fs_visitor.cpp:986
#1 0x559fadb46db3 in fs_visitor::fs_visitor(brw_compiler const*, void*, void*, brw_base_prog_key const*, brw_stage_prog_data*, nir_shader const*, unsigned int, int, brw_vue_map const*) ../src/intel/compiler/brw_fs_visitor.cpp:962
#2 0x559fad9c7cd8 in saturate_propagation_fs_visitor::saturate_propagation_fs_visitor(brw_compiler*, brw_wm_prog_data*, nir_shader*) (/home/daenzer/src/mesa-git/mesa/build-amd64-sanitize/src/intel/compiler/fs_saturate_propagation+0x61bcd8)
#3 0x559fad9960a1 in saturate_propagation_test::SetUp() ../src/intel/compiler/test_fs_saturate_propagation.cpp:65
#4 0x559fadd7a32d in void testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) ../src/gtest/src/gtest.cc:2402
#5 0x559fadd65c3b in void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) ../src/gtest/src/gtest.cc:2438
#6 0x559fadd0af75 in testing::Test::Run() ../src/gtest/src/gtest.cc:2470
#7 0x559fadd0d8a4 in testing::TestInfo::Run() ../src/gtest/src/gtest.cc:2656
#8 0x559fadd10032 in testing::TestCase::Run() ../src/gtest/src/gtest.cc:2774
#9 0x559fadd2ba0c in testing::internal::UnitTestImpl::RunAllTests() ../src/gtest/src/gtest.cc:4649
#10 0x559fadd7df46 in bool testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) ../src/gtest/src/gtest.cc:2402
#11 0x559fadd69613 in bool testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) ../src/gtest/src/gtest.cc:2438
#12 0x559fadd2302e in testing::UnitTest::Run() ../src/gtest/src/gtest.cc:4257
#13 0x559fadda2d61 in RUN_ALL_TESTS() ../src/gtest/include/gtest/gtest.h:2233
#14 0x559fadda2c21 in main ../src/gtest/src/gtest_main.cc:37
#15 0x7fe8f6748bba in __libc_start_main ../csu/libc-start.c:308
#16 0x559fad9950f9 in _start (/home/daenzer/src/mesa-git/mesa/build-amd64-sanitize/src/intel/compiler/fs_saturate_propagation+0x5e90f9)
Reviewed-by: Jason Ekstrand <[email protected]>
Reviewed-by: Adam Jackson <[email protected]>
Diffstat (limited to 'src/intel')
-rw-r--r-- | src/intel/compiler/brw_fs_visitor.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/intel/compiler/brw_fs_visitor.cpp b/src/intel/compiler/brw_fs_visitor.cpp index c7feea12c45..ce51268ec8d 100644 --- a/src/intel/compiler/brw_fs_visitor.cpp +++ b/src/intel/compiler/brw_fs_visitor.cpp @@ -900,7 +900,10 @@ fs_visitor::fs_visitor(const struct brw_compiler *compiler, void *log_data, void fs_visitor::init() { - this->key_tex = &key->tex; + if (key) + this->key_tex = &key->tex; + else + this->key_tex = NULL; this->max_dispatch_width = 32; this->prog_data = this->stage_prog_data; |