diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2018-01-05 16:17:10 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2018-01-05 16:17:10 +0200 |
commit | f1b3c0e86daec1f5b7ed81a60edbe548fcbb5f42 (patch) | |
tree | 1d87d8960626f7128d797c00459061991931418a | |
parent | 76de594667b370094f5da5c0871c155d788d135e (diff) |
Work around bogus ubsan report
-rw-r--r-- | build2/diagnostics.cxx | 2 | ||||
-rw-r--r-- | build2/test/script/parser.cxx | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/build2/diagnostics.cxx b/build2/diagnostics.cxx index b1f2796..f04751c 100644 --- a/build2/diagnostics.cxx +++ b/build2/diagnostics.cxx @@ -40,7 +40,7 @@ namespace build2 #else __thread #endif - const diag_frame* diag_frame::stack; + const diag_frame* diag_frame::stack = nullptr; // Diagnostic facility, project specifics. // diff --git a/build2/test/script/parser.cxx b/build2/test/script/parser.cxx index 19bcb5c..d1e2816 100644 --- a/build2/test/script/parser.cxx +++ b/build2/test/script/parser.cxx @@ -3016,6 +3016,7 @@ namespace build2 // If the scope was executed synchronously, check the status // and bail out if we weren't asked to keep going. // + const diag_frame* df (diag_frame::stack); // UBSan workaround. if (!sched.async (task_count, [] (scope& s, script& scr, @@ -3028,7 +3029,7 @@ namespace build2 ref (*chain), ref (*script_), ref (*runner_), - diag_frame::stack)) + df)) { // Bail out if the scope has failed and we weren't instructed // to keep going. |