提交 e1107884 编写于 作者: P Peter Maydell 提交者: Michael Tokarev

disas/cris.c: Fix Coverity warning about unchecked NULL

Coverity (CID 1005689) warns that we don't check that
spec_reg_info() returned non-NULL before dereferencing.
Add the check, though as the comment notes this is
a can't-really-happen case because the earlier constraint
matching should have ruled out the "unknown reg" case.
Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
Reviewed-by: NEdgar E. Iglesias <edgar.iglesias@xilinx.com>
Signed-off-by: NMichael Tokarev <mjt@tls.msk.ru>
上级 4382fa65
......@@ -2490,7 +2490,7 @@ print_with_operands (const struct cris_opcode *opcodep,
const struct cris_spec_reg *sregp
= spec_reg_info ((insn >> 12) & 15, disdata->distype);
if (sregp->name == NULL)
if (sregp == NULL || sregp->name == NULL)
/* Should have been caught as a non-match earlier. */
*tp++ = '?';
else
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册