mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-11 08:29:25 +00:00
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123235 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -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> {
|
||||
};
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user