This is an archive of the discontinued LLVM Phabricator instance.

[MC] Fix assembler infinite loop on EH table using LEB padding
ClosedPublic

Authored by rprichard on Jan 30 2018, 4:13 PM.

Details

Summary

Fix the infinite loop reported in PR35809. It can occur with GCC-style
EH table assembly, where the compiler relies on the assembler to
calculate the offsets in the EH table.

Also see https://sourceware.org/bugzilla/show_bug.cgi?id=4029 for the
equivalent issue in the GNU assembler.

Diff Detail

Event Timeline

rprichard created this revision.Jan 30 2018, 4:13 PM

This looks great. Thanks for resolving this problem.

Remove the RelaxAllowances behavior where an LEB fragment could be shrunk a
fixed number of times. Instead, never shrink an LEB fragment.

Also remove the uleb-optimal.s test. The LLVM assembler will output a padded
LEB for this test, but it previously would not have. The assembler is not
obligated to pad that LEB.

espindola accepted this revision.Jan 31 2018, 4:27 PM
This revision is now accepted and ready to land.Jan 31 2018, 4:27 PM