aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2019-04-16 17:21:36 -0700
committerMichael Forney <mforney@mforney.org>2019-04-16 17:21:36 -0700
commit2d2903b113c99f5202105e3915f616181b896c90 (patch)
tree7d3a00748a38a68b02f12bdf536212f2af0a8287
parent70a293121f71e2481fd5b85007195c879cf218ef (diff)
Error instead of segfault when working with `long double`
-rw-r--r--qbe.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/qbe.c b/qbe.c
index 2a05456..4d24581 100644
--- a/qbe.c
+++ b/qbe.c
@@ -1020,6 +1020,8 @@ emitvalue(struct value *v)
static void
emitrepr(struct repr *r, bool abi, bool ext)
{
+ if (!r)
+ fatal("type has no QBE representation");
if (abi && r->abi.id) {
putchar(':');
emitname(&r->abi);