aboutsummaryrefslogtreecommitdiffstats
path: root/src/vhdl/iirs_utils.adb
diff options
context:
space:
mode:
Diffstat (limited to 'src/vhdl/iirs_utils.adb')
-rw-r--r--src/vhdl/iirs_utils.adb6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/vhdl/iirs_utils.adb b/src/vhdl/iirs_utils.adb
index 536238bef..32e52f77f 100644
--- a/src/vhdl/iirs_utils.adb
+++ b/src/vhdl/iirs_utils.adb
@@ -1571,8 +1571,10 @@ package body Iirs_Utils is
Res : Iir;
begin
Res := Create_Iir (Iir_Kind_Error);
- Set_Error_Origin (Res, Orig);
- Location_Copy (Res, Orig);
+ if Orig /= Null_Iir then
+ Set_Error_Origin (Res, Orig);
+ Location_Copy (Res, Orig);
+ end if;
return Res;
end Create_Error;