From 92037b5e7c4979584624aaa50f45f9309dd20c95 Mon Sep 17 00:00:00 2001 From: Basile Burg Date: Sat, 24 Dec 2016 19:55:33 +0100 Subject: [PATCH] prevent possible segfault with instructions without params, like RDTSC --- src/analysis/unused_label.d | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/analysis/unused_label.d b/src/analysis/unused_label.d index 59fd817..fe9ddad 100644 --- a/src/analysis/unused_label.d +++ b/src/analysis/unused_label.d @@ -101,7 +101,7 @@ final class UnusedLabelCheck : BaseAnalyzer if (instr.identifierOrIntegerOrOpcode.text.length) jmp = instr.identifierOrIntegerOrOpcode.text[0] == 'j'; - if (!jmp || instr.operands.operands.length != 1) + if (!jmp || !instr.operands || instr.operands.operands.length != 1) return; const AsmExp e = cast(AsmExp) instr.operands.operands[0];