mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-20 12:31:40 +00:00
[PBQP] Check for out of bound access in DEBUG builds
It is just too easy to use a virtual register intead of a NodeId without a compiler warning. This does not fix the fundamental problem, i.e. both have the same underlying types, but increases the likelyhood to detect it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220303 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
a5d0ebdbc2
commit
d57a1ba630
@ -190,8 +190,14 @@ namespace PBQP {
|
||||
|
||||
// ----- INTERNAL METHODS -----
|
||||
|
||||
NodeEntry& getNode(NodeId NId) { return Nodes[NId]; }
|
||||
const NodeEntry& getNode(NodeId NId) const { return Nodes[NId]; }
|
||||
NodeEntry &getNode(NodeId NId) {
|
||||
assert(NId < Nodes.size() && "Out of bound NodeId");
|
||||
return Nodes[NId];
|
||||
}
|
||||
const NodeEntry &getNode(NodeId NId) const {
|
||||
assert(NId < Nodes.size() && "Out of bound NodeId");
|
||||
return Nodes[NId];
|
||||
}
|
||||
|
||||
EdgeEntry& getEdge(EdgeId EId) { return Edges[EId]; }
|
||||
const EdgeEntry& getEdge(EdgeId EId) const { return Edges[EId]; }
|
||||
|
Loading…
x
Reference in New Issue
Block a user