Program crash if -vec > 0 is used.
Affects:
GAS target x86
Note: (Others may be affected as well but -gen GAS -arch 32 reliably triggers the crash)
Description:
Code works with -vec 0 but crashes if -vec > 0 is used.
Minimum reproducible code:
Code: Select all
'// Specific FBC commandline parameters that triggers the crash: -gen GAS -fpu SSE -vec 2 -arch 32
'fbcs: -exx -g -gen GAS -fpu SSE -vec 2 -arch 32
'Triggers:
'// Aborting due to runtime error 12 ("segmentation violation" signal) in [...].bas::VECTOR_CONVERT()
'
type vec2f
x as single
y as single
end type
type vec2d
x as double
y as double
end type
function vector_convert overload (byval v as vec2d) as vec2f
dim as vec2f r
r.x = v.x
r.y = v.y
return r
end function
function vector_convert(byval v as vec2f) as vec2d
dim as vec2d r
r.x = v.x
r.y = v.y
return r
end function
dim as vec2d camera_dpos
dim as vec2f camera_spos
camera_spos = vector_convert(camera_dpos)
' Program received signal SIGSEGV, Segmentation fault.
' __Z14VECTOR_CONVERT5VEC2D@16 (V=...)
' at E:\Programming\!random stuff\stuff.bas:16
' 16 r.x = v.x