This is an archive of the discontinued LLVM Phabricator instance.

[Interpreter] Fix out-of-bounds access in ffiInvoke
ClosedPublic

Authored by eush on Oct 22 2018, 11:32 PM.

Details

Summary

This commit fixes "attempt to subscript container with out-of-bounds
index" error reported by the GNU C++ Library in debug mode (enabled by
LLVM_ENABLE_EXPENSIVE_CHECKS).

Diff Detail

Event Timeline

eush created this revision.Oct 22 2018, 11:32 PM
nicholas accepted this revision.Oct 23 2018, 12:43 AM
nicholas added inline comments.
test/ExecutionEngine/Interpreter/rand.ll
1 ↗(On Diff #170572)

This matches the style in intrinsics.ll, but alias.ll uses "%lli -force-interpreter %s", the differences being that it uses %lli instead of lli and does not use < redirection. I do not know which style is correct or preferred.

This revision is now accepted and ready to land.Oct 23 2018, 12:43 AM
eush updated this revision to Diff 172489.Nov 3 2018, 2:24 AM

I grepped the code base, and it seems that the style in alias.ll is much
more common, in particular intrinsics.ll is the only test that runs lli with
input redirection, so I changed the test to match the style in alias.ll
instead.

I also renamed the test to better indicate what it is about.

eush added inline comments.Nov 3 2018, 2:28 AM
test/ExecutionEngine/Interpreter/rand.ll
1 ↗(On Diff #170572)

I created https://llvm.org/PR39524 about using lli vs %lli in tests. There is no resolution on that yet.

eush added a comment.Nov 8 2018, 6:18 AM

Could you commit this patch on my behalf?

Could you commit this patch on my behalf?

I have been away from the LLVM community for a few years and am not comfortable committing a patch without review from a current committer.

Could someone on llvm-commits please take a look?

eush retitled this revision from [ExecutionEngine] Fix out-of-bounds access in the interpreter to [Interpreter] Fix out-of-bounds access in ffiInvoke.Nov 15 2018, 7:04 PM
lhames accepted this revision.Nov 19 2018, 5:04 PM

LGTM. Committed as r347281. Thanks Eugene!

lhames closed this revision.Nov 19 2018, 5:04 PM