aboutsummaryrefslogtreecommitdiff
path: root/target/xtensa/helper.c
diff options
context:
space:
mode:
authorMax Filippov <jcmvbkbc@gmail.com>2020-04-06 20:59:54 -0700
committerMax Filippov <jcmvbkbc@gmail.com>2020-04-07 16:08:11 -0700
commitfde557ad25ff3370ef1dd0587d299a86e060bb23 (patch)
tree03efe47629182bac2fd9f54ab1942a8f22753591 /target/xtensa/helper.c
parent1a03362b14affa4d8ddede55df6e21d7a07b87c2 (diff)
downloadqemu-fde557ad25ff3370ef1dd0587d299a86e060bb23.zip
qemu-fde557ad25ff3370ef1dd0587d299a86e060bb23.tar.gz
qemu-fde557ad25ff3370ef1dd0587d299a86e060bb23.tar.bz2
target/xtensa: statically allocate xtensa_insnbufs in DisasContext
Rather than dynamically allocate, and risk failing to free when we longjmp out of the translator, allocate the maximum buffer size based on the maximum supported instruction length. Suggested-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Tested-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'target/xtensa/helper.c')
-rw-r--r--target/xtensa/helper.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/target/xtensa/helper.c b/target/xtensa/helper.c
index 376a61f..7073381 100644
--- a/target/xtensa/helper.c
+++ b/target/xtensa/helper.c
@@ -96,6 +96,7 @@ static void init_libisa(XtensaConfig *config)
config->isa = xtensa_isa_init(config->isa_internal, NULL, NULL);
assert(xtensa_isa_maxlength(config->isa) <= MAX_INSN_LENGTH);
+ assert(xtensa_insnbuf_size(config->isa) <= MAX_INSNBUF_LENGTH);
opcodes = xtensa_isa_num_opcodes(config->isa);
formats = xtensa_isa_num_formats(config->isa);
regfiles = xtensa_isa_num_regfiles(config->isa);