summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMaximilian Stemmer-Grabow <mail@mxsg.de>2021-05-27 16:18:25 +0200
committerAndreas Fried <andreas.fried@kit.edu>2021-12-02 12:57:28 +0100
commite8b3b07b54721042b0b7d5683765e433cb091c23 (patch)
tree70e8586c53efde55f0ba6dc586990267d012d349
parente8bd8377d3f822bd455c0dda52dffa366577a4c3 (diff)
Guard against unset registers when checking for compressibility
-rw-r--r--ir/be/riscv/riscv_compression.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ir/be/riscv/riscv_compression.c b/ir/be/riscv/riscv_compression.c
index a479379..6745fa7 100644
--- a/ir/be/riscv/riscv_compression.c
+++ b/ir/be/riscv/riscv_compression.c
@@ -176,8 +176,11 @@ int riscv_get_op_compression_requirements(ir_node const *const node)
return (int)requirement;
}
-static bool riscv_register_is_compressible(arch_register_t *const reg)
+static bool riscv_register_is_compressible(const arch_register_t *const reg)
{
+ // Guard against unset registers
+ if (!reg) return false;
+
return reg->is_compressible;
}