This is an archive of the discontinued LLVM Phabricator instance.

[X86] Don't give catch objects a displacement of zero
ClosedPublic

Authored by majnemer on Mar 2 2016, 11:04 AM.

Details

Summary

Catch objects with a displacement of zero do not initialize a catch
object. The displacement is relative to %rsp at the end of the
function's prologue for x86_64 targets.

If we place an object at the top-of-stack, we will end up wit a
displacement of zero resulting in our catch object remaining
uninitialized.

Address this by creating our catch objects as fixed objects. We will
ensure that the UnwindHelp object is created after the catch objects so
that no catch object will have a displacement of zero.

Diff Detail

Repository
rL LLVM

Event Timeline

majnemer updated this revision to Diff 49650.Mar 2 2016, 11:04 AM
majnemer retitled this revision from to [X86] Don't give catch objects a displacement of zero.
majnemer updated this object.
majnemer added a reviewer: rnk.
majnemer added a subscriber: llvm-commits.
rnk accepted this revision.Mar 2 2016, 11:31 AM
rnk edited edge metadata.

lgtm

lib/Target/X86/X86FrameLowering.cpp
2847 ↗(On Diff #49650)

Dead variable

This revision is now accepted and ready to land.Mar 2 2016, 11:31 AM
This revision was automatically updated to reflect the committed changes.