Sanity check on order offset when hashing

This commit is contained in:
Greg Hysen 2019-09-06 15:28:07 -07:00
parent f477c0fcc2
commit 1dc1218bfc

View File

@ -133,6 +133,11 @@ library LibOrder {
// )); // ));
assembly { assembly {
// Assert order offset (this is an internal error that should never be triggered)
if lt(order, 32) {
invalid()
}
// Calculate memory addresses that will be swapped out before hashing // Calculate memory addresses that will be swapped out before hashing
let pos1 := sub(order, 32) let pos1 := sub(order, 32)
let pos2 := add(order, 320) let pos2 := add(order, 320)