llvm.org GIT mirror llvm / 6ae9027
hwasan: Fix use of uninitialized memory. Reported by e.g. http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/builds/23071/steps/build%20with%20ninja/logs/stdio git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369815 91177308-0d34-0410-b5e6-96231b3b80d8 Peter Collingbourne 28 days ago
1 changed file(s) with 12 addition(s) and 11 deletion(s). Raw diff Collapse all Expand all
368368 Int32Ty = IRB.getInt32Ty();
369369
370370 HwasanCtorFunction = nullptr;
371
372 // Older versions of Android do not have the required runtime support for
373 // global or personality function instrumentation. On other platforms we
374 // currently require using the latest version of the runtime.
375 bool NewRuntime =
376 !TargetTriple.isAndroid() || !TargetTriple.isAndroidVersionLT(30);
377
378 // If we don't have personality function support, fall back to landing pads.
379 InstrumentLandingPads = ClInstrumentLandingPads.getNumOccurrences()
380 ? ClInstrumentLandingPads
381 : !NewRuntime;
382
371383 if (!CompileKernel) {
372384 std::tie(HwasanCtorFunction, std::ignore) =
373385 getOrCreateSanitizerCtorAndInitFunctions(
382394 appendToGlobalCtors(M, Ctor, 0, Ctor);
383395 });
384396
385 // Older versions of Android do not have the required runtime support for
386 // global or personality function instrumentation. On other platforms we
387 // currently require using the latest version of the runtime.
388 bool NewRuntime =
389 !TargetTriple.isAndroid() || !TargetTriple.isAndroidVersionLT(30);
390
391397 bool InstrumentGlobals =
392398 ClGlobals.getNumOccurrences() ? ClGlobals : NewRuntime;
393399 if (InstrumentGlobals)
394400 instrumentGlobals();
395
396 // If we don't have personality function support, fall back to landing pads.
397 InstrumentLandingPads = ClInstrumentLandingPads.getNumOccurrences()
398 ? ClInstrumentLandingPads
399 : !NewRuntime;
400401
401402 bool InstrumentPersonalityFunctions =
402403 ClInstrumentPersonalityFunctions.getNumOccurrences()