]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
include/exec: fix assert in size_memop
authorAlex Bennée <alex.bennee@linaro.org>
Tue, 3 Jun 2025 11:02:00 +0000 (12:02 +0100)
committerAlex Bennée <alex.bennee@linaro.org>
Sat, 7 Jun 2025 15:40:44 +0000 (16:40 +0100)
We can handle larger sized memops now, expand the range of the assert.

Fixes: 4b473e0c60 (tcg: Expand MO_SIZE to 3 bits)
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-ID: <20250603110204.838117-14-alex.bennee@linaro.org>

include/exec/memop.h

index 407a47d82c7ef4dad2fe2473b5e0b8204abf9db2..cf7da3362e8f8b86ace983a35b61cf36aad4bd66 100644 (file)
@@ -162,8 +162,8 @@ static inline unsigned memop_size(MemOp op)
 static inline MemOp size_memop(unsigned size)
 {
 #ifdef CONFIG_DEBUG_TCG
-    /* Power of 2 up to 8.  */
-    assert((size & (size - 1)) == 0 && size >= 1 && size <= 8);
+    /* Power of 2 up to 1024 */
+    assert(is_power_of_2(size) && size >= 1 && size <= (1 << MO_SIZE));
 #endif
     return (MemOp)ctz32(size);
 }