From 008ea12dd93b9f9104f0b532b278a31b719bafb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96mer=20Sinan=20A=C4=9Facan?= Date: Sun, 17 Jun 2018 12:50:18 -0400 Subject: Use __FILE__ for Cmm assertion locations, fix #8619 It seems like we currently support string literals in Cmm, so we can use __LINE__ CPP macro in assertion macros. This improves error messages that previously looked like ASSERTION FAILED: file (null), line 1302 (null) part now shows the actual file name. Also inline some single-use string literals in PrimOps.cmm. Reviewers: bgamari, simonmar, erikd Reviewed By: bgamari Subscribers: rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4862 --- includes/Cmm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'includes') diff --git a/includes/Cmm.h b/includes/Cmm.h index 1306a2222d..059220a813 100644 --- a/includes/Cmm.h +++ b/includes/Cmm.h @@ -211,7 +211,7 @@ if (predicate) { \ /*null*/; \ } else { \ - foreign "C" _assertFail(NULL, __LINE__) never returns; \ + foreign "C" _assertFail(__FILE__, __LINE__) never returns; \ } #else #define ASSERT(p) /* nothing */ -- cgit v1.2.1