commit | fae38221e78fc9f847965f6d18b359b8044df348 | [log] [tgz] |
---|---|---|
author | zhanghailiang <zhang.zhanghailiang@huawei.com> | Mon Nov 17 13:57:34 2014 +0800 |
committer | Paolo Bonzini <pbonzini@redhat.com> | Mon Nov 17 13:59:23 2014 +0100 |
tree | f34239a249594acc310c572682c63904d9fa9197 | |
parent | 0e8b439ae57ee3c46fb95e1775ea038d34496346 [diff] |
target-cris/translate.c: fix out of bounds read In function t_gen_mov_TN_preg and t_gen_mov_preg_TN, The begin check about the validity of in-parameter 'r' is useless. We still access cpu_PR[r] in the follow code if it is invalid. Which will be an out-of-bounds read error. Fix it by using assert() to ensure it is valid before using it. Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>