This is an archive of the discontinued LLVM Phabricator instance.

[asan] Fixed a bug causing a crash when redzone optimization kicked in on X86 with -asan-optimize-callbacks flag on.
ClosedPublic

Authored by kstoimenov on Sep 17 2021, 4:00 PM.

Details

Summary

This change adds the ASan intrinsic to the list whihc are setting hasCopyImplyingStackAdjustment.

Diff Detail

Event Timeline

kstoimenov created this revision.Sep 17 2021, 4:00 PM
kstoimenov requested review of this revision.Sep 17 2021, 4:00 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 17 2021, 4:00 PM

Added tests.

Switched to using AdjustsStack instead of HasCopyImplyingStackAdjustment.

Removed dead code.

Switched to AdjustsStack. PTAL.

eugenis added inline comments.Sep 21 2021, 11:48 AM
llvm/lib/Target/X86/X86ISelLowering.cpp
27014

Does the intrinsic have to be x86-specific? AFAIK it is fine to have x86-specific handling of a generic intrinsic.

llvm/test/CodeGen/X86/asan-check-memaccess-or.ll
8

CHECK-NEXT, or CHECK-NOT: something-%rbp to make sure we are not force-enabling the frame pointer

kstoimenov marked an inline comment as done.

Moved back to generic intrinsic.

After rebase.

Added a blank line back.

kstoimenov marked an inline comment as done.Sep 21 2021, 2:59 PM
kstoimenov added inline comments.
llvm/lib/Target/X86/X86ISelLowering.cpp
27014

I reverted it back to a generic intrinsic.

eugenis accepted this revision.Sep 21 2021, 3:19 PM

LGTM

llvm/lib/Target/X86/X86ISelLowering.cpp
27015

This comment simply repeats what the next line says, in the exact same words.
It would be better to briefly explain why this is needed instead.

This revision is now accepted and ready to land.Sep 21 2021, 3:19 PM

Fixed a comment.

kstoimenov marked an inline comment as done.

Fixed a comment.

This revision was landed with ongoing or failed builds.Sep 21 2021, 3:26 PM
This revision was automatically updated to reflect the committed changes.