diff options
author | Mark Seaborn <mseaborn@chromium.org> | 2013-04-04 10:46:59 -0700 |
---|---|---|
committer | Mark Seaborn <mseaborn@chromium.org> | 2013-04-04 10:46:59 -0700 |
commit | 7ff3c9d24918270e4a001c712e2e153d7e27da5e (patch) | |
tree | 89c618ca1229d3814f5ffb239334b0f9a9d62c6d /lib/Bitcode/Reader/BitReader.cpp | |
parent | 99681c41b0bf46e9973cf4b3ef6d0b792103f29d (diff) |
PNaCl: Change ExpandVarArgs to work around invalid use of va_arg
I've encountered two uses of va_arg on an empty argument list: NaCl's
open() wrapper (now fixed), and 176.gcc in Spec2k. Although this is
invalid use of va_arg (giving undefined behaviour), it's too awkward
to fix 176.gcc.
Work around this invalid usage by ensuring that the argument list
pointer points to a location on the stack rather than being
uninitialised. va_arg will return undefined values as it does in the
usual native ABIs, rather than crashing.
We could add options for non-strict and strict modes (possibly with a
bounds check), but that's too much complication for now.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3338
TEST=test/Transforms/NaCl/*.ll + ran 176.gcc from Spec2k
Review URL: https://codereview.chromium.org/13510004
Diffstat (limited to 'lib/Bitcode/Reader/BitReader.cpp')
0 files changed, 0 insertions, 0 deletions