morpho
morpho copied to clipboard
[Bug] Segfault upon incorrect assginment in function call
Describe the bug
A typo in the constructor for FloryHuggins
results in a segfault
To Reproduce
var m = Mesh("tetrahedron.mesh") // Can be found under test/functionals/floryhuggins
var mref = m.clone()
var lfh = FloryHuggins(mref. // This "." should be a ","
a = 1.0,
b = 1.0,
c = 1.0,
phi0=0.5
)
print lfh
Expected behavior Some error indicating that the period is incorrect
This segfaults in program_bindobject in vm/vim.c:100 obj it in invalid pointer We should probably catch this as a parse error before this happens as mref. is not valid.
Assignment in fn call
Fixed by #276 (and possibly earlier).
- The supplied program now generates "Expression expected" error.
- Added a test class/syntax_error_in_constructor.morpho to check this works correctly.
Thankyou @ConduitDan for this report; apologies it took a long time to be fixed by the new parser in the 0.6 series.