Revert "Revert "Ensure that buffer disassembly will never read outside the buffer.""
This reverts commit 5d4a535c785cf1e911fa74b97f73298aecbd02ae, with the
appropriate fixes.
Change-Id: I8a3bad3bab9cc68495d6c0cfe2a78521fc947715
diff --git a/src/utils-vixl.h b/src/utils-vixl.h
index 2147480..45dce57 100644
--- a/src/utils-vixl.h
+++ b/src/utils-vixl.h
@@ -368,6 +368,11 @@
return result;
}
+template <unsigned MULTIPLE, typename T>
+inline bool IsMultiple(T value) {
+ VIXL_ASSERT(IsPowerOf2(MULTIPLE));
+ return (value & (MULTIPLE - 1)) == 0;
+}
// Pointer alignment
// TODO: rename/refactor to make it specific to instructions.