pan/genxml: Fix decode of exception_handler 0x0

Fixes the check for address 0x0 or length 0 when decoding
set_exception_handler.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31941>
This commit is contained in:
Lars-Ivar Hesselberg Simonsen 2024-11-08 16:25:40 +01:00
parent 8fc640b256
commit 565476d3b2

View file

@ -837,6 +837,12 @@ interpret_ceu_jump(struct pandecode_context *ctx, struct queue_ctx *qctx,
/* Map the entire subqueue now */
uint64_t address = ((uint64_t)address_hi << 32) | address_lo;
/* Return if the jump is for an exception handler that's set to zero */
if (qctx->in_exception_handler && (!address || !length)) {
qctx->in_exception_handler = false;
qctx->call_stack_depth--;
return true;
}
uint64_t *cs = pandecode_fetch_gpu_mem(ctx, address, length);
qctx->ip = cs;
@ -980,8 +986,6 @@ interpret_ceu_instr(struct pandecode_context *ctx, struct queue_ctx *qctx)
case MALI_CS_OPCODE_SET_EXCEPTION_HANDLER: {
pan_unpack(bytes, CS_SET_EXCEPTION_HANDLER, I);
if (!I.address) return true;
assert(qctx->call_stack_depth < MAX_CALL_STACK_DEPTH);
qctx->ip++;