diff options
author | Jay Foad <jay.foad@gmail.com> | 2011-01-11 15:07:38 +0000 |
---|---|---|
committer | Jay Foad <jay.foad@gmail.com> | 2011-01-11 15:07:38 +0000 |
commit | c8adf5f4584677007900043e86d012846f485de9 (patch) | |
tree | e853c9a9003b2d719235b038da6cbe14c89c0d1d /llvm/lib/Bitcode/Reader/BitcodeReader.cpp | |
parent | 8e158495f11e42a606d96b19707aa20b574259eb (diff) | |
download | bcm5719-llvm-c8adf5f4584677007900043e86d012846f485de9.tar.gz bcm5719-llvm-c8adf5f4584677007900043e86d012846f485de9.zip |
FixedNumOperandTraits and VariadicOperandTraits assumed that, given a
"this" pointer for any subclass of User, you could static_cast it to
User* and then reinterpret_cast that to Use* to get the end of the
operand list. This isn't a safe assumption in general, because the
static_cast might adjust the "this" pointer. Fixed by having these
OperandTraits classes take an extra template parameter, which is the
subclass of User. This is groundwork for PR889.
llvm-svn: 123235
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
-rw-r--r-- | llvm/lib/Bitcode/Reader/BitcodeReader.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp index 7a71b267eaa..adcad749891 100644 --- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp @@ -162,7 +162,8 @@ namespace { // FIXME: can we inherit this from ConstantExpr? template <> -struct OperandTraits<ConstantPlaceHolder> : public FixedNumOperandTraits<1> { +struct OperandTraits<ConstantPlaceHolder> : + public FixedNumOperandTraits<ConstantPlaceHolder, 1> { }; } |