mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-02 07:11:49 +00:00
Fix size/offset assertion to allow negative offsets and folded nodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13644 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
79333da2bb
commit
44860ccaf2
@ -386,7 +386,14 @@ struct ilist_traits<const DSNode> : public ilist_traits<DSNode> {};
|
||||
// Define inline DSNodeHandle functions that depend on the definition of DSNode
|
||||
//
|
||||
inline DSNode *DSNodeHandle::getNode() const {
|
||||
assert((!N || Offset < N->Size || (N->Size == 0 && Offset == 0) ||
|
||||
// Disabling this assertion because it is failing on a "magic" struct
|
||||
// in named (from bind). The fourth field is an array of length 0,
|
||||
// presumably used to create struct instances of different sizes.
|
||||
assert((!N ||
|
||||
N->isNodeCompletelyFolded() ||
|
||||
(N->Size == 0 && Offset == 0) ||
|
||||
(int(Offset) >= 0 && Offset < N->Size) ||
|
||||
(int(Offset) < 0 && -int(Offset) < int(N->Size)) ||
|
||||
N->isForwarding()) && "Node handle offset out of range!");
|
||||
if (N == 0 || !N->isForwarding())
|
||||
return N;
|
||||
|
@ -386,7 +386,14 @@ struct ilist_traits<const DSNode> : public ilist_traits<DSNode> {};
|
||||
// Define inline DSNodeHandle functions that depend on the definition of DSNode
|
||||
//
|
||||
inline DSNode *DSNodeHandle::getNode() const {
|
||||
assert((!N || Offset < N->Size || (N->Size == 0 && Offset == 0) ||
|
||||
// Disabling this assertion because it is failing on a "magic" struct
|
||||
// in named (from bind). The fourth field is an array of length 0,
|
||||
// presumably used to create struct instances of different sizes.
|
||||
assert((!N ||
|
||||
N->isNodeCompletelyFolded() ||
|
||||
(N->Size == 0 && Offset == 0) ||
|
||||
(int(Offset) >= 0 && Offset < N->Size) ||
|
||||
(int(Offset) < 0 && -int(Offset) < int(N->Size)) ||
|
||||
N->isForwarding()) && "Node handle offset out of range!");
|
||||
if (N == 0 || !N->isForwarding())
|
||||
return N;
|
||||
|
Loading…
Reference in New Issue
Block a user