Skip to content

Commit 8d02da3

Browse files
committed
Fix error stop output from LFortran
Previously assertion failures on LFortran were printing garbage
1 parent eb78994 commit 8d02da3

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/assert_m.F90

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ pure subroutine assert_always(assertion, description, file, line)
104104
allocate(character(len=0)::message)
105105
allocate(character(len=0)::location)
106106

107+
107108
! format source location, if known
108109
location = ''
109110
if (present(file)) then
@@ -146,7 +147,13 @@ pure subroutine assert_always(assertion, description, file, line)
146147
; ! deliberate fall-thru
147148
endif
148149
#endif
150+
#ifdef __LFORTRAN__
151+
! workaround a defect observed in LFortran 0.54:
152+
! error stop with an allocatable character argument prints garbage
153+
error stop message//'', QUIET=.false.
154+
#else
149155
error stop message, QUIET=.false.
156+
#endif
150157

151158
end if check_assertion
152159

0 commit comments

Comments
 (0)