mirror of
https://github.com/fadden/6502bench.git
synced 2024-12-27 10:32:31 +00:00
Fix edge-face validation check
This commit is contained in:
parent
662dda106f
commit
8ff1fa7034
@ -27,6 +27,14 @@ namespace PluginCommon {
|
||||
/// <remarks>
|
||||
/// This is currently simple enough that it could just be an interface, but I don't want
|
||||
/// to rely on that remaining true.
|
||||
///
|
||||
/// TODO(maybe): add a "IsAddressRangeValid(int srcOffset, int addr, int length)" method
|
||||
/// that verifies an entire address range is in memory. This would allow subsequent access
|
||||
/// to skip error checks. (You still have to do the address-to-offset translation on every
|
||||
/// byte though, which is where most of the expense is.)
|
||||
/// TODO(maybe): add a "CopyAddressRange(byte[] data, int srcOffset, int addr, int length)"
|
||||
/// that returns a newly-allocated buffer with the data copied out. This would allow fast
|
||||
/// access to data that is split into multiple regions.
|
||||
/// </remarks>
|
||||
public class AddressTranslate {
|
||||
private AddressMap mAddrMap;
|
||||
|
@ -192,7 +192,7 @@ namespace PluginCommon {
|
||||
}
|
||||
|
||||
// check edge-faces
|
||||
foreach (IntPair ip in mVertexFaces) {
|
||||
foreach (IntPair ip in mEdgeFaces) {
|
||||
if (ip.Val0 < 0 || ip.Val0 >= edgeCount ||
|
||||
ip.Val1 < 0 || ip.Val1 >= faceCount) {
|
||||
msg = "invalid edge-face (e=" + ip.Val0 + ", f=" + ip.Val1 + ")";
|
||||
|
Loading…
Reference in New Issue
Block a user