From b82d9200144692e9ddf1c35c0251f669cfbb2e71 Mon Sep 17 00:00:00 2001 From: Josh Davies Date: Tue, 31 Mar 2026 13:08:55 +0100 Subject: [PATCH] fix: segfault after unrecognised moduleoption --- check/fixes.frm | 7 +++++++ sources/module.c | 1 + 2 files changed, 8 insertions(+) diff --git a/check/fixes.frm b/check/fixes.frm index e3a22cd5..43acb3ca 100644 --- a/check/fixes.frm +++ b/check/fixes.frm @@ -4437,6 +4437,13 @@ assert result("testCF1") =~ expr("putfirst_(f,2,mu1)*putfirst_(e,2,mu1)*putfirst assert result("testCF2") =~ expr("d(mu2,mu1)*e(mu2,mu1)*f(mu2,mu1)") assert result("testCF3") =~ expr("d(mu2,mu1,mu3)*e(mu2,mu1,mu3)*f(mu2,mu1,mu3)") *--#] Issue750 : +*--#[ Issue760 : +ModuleOption foo; +ModuleOption parallel,foo; +ModuleOption foo,parallel; +.end +assert preprocess_error?("Unrecognized module option: foo") +*--#] Issue760 : *--#[ Issue766 : * Unintended "&" in some warning messages CF f(s,s); diff --git a/sources/module.c b/sources/module.c index 86ec356d..9939091b 100644 --- a/sources/module.c +++ b/sources/module.c @@ -170,6 +170,7 @@ int CoModuleOption(UBYTE *s) SKIPBLANKS(t) if ( (option->func)(t) ) error = 1; } + if ( error ) return(error); if ( StrCmp((UBYTE *)(option->name),(UBYTE *)("polyfun")) == 0 || StrCmp((UBYTE *)(option->name),(UBYTE *)("polyratfun")) == 0 ) { polyflag = 1;