From 8d7b0a2a6c5d5d00f6ea3f0fcef7aa9cfe561718 Mon Sep 17 00:00:00 2001 From: Takahiro Ueda Date: Tue, 14 Mar 2023 18:13:16 +0900 Subject: [PATCH] fix: crash with square-bracketed names (#1) Close #1 --- forcer/forcer-aux.h | 16 ++++++++-------- forcer/forcer-rules.h | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/forcer/forcer-aux.h b/forcer/forcer-aux.h index 79c126e..ffb6c25 100644 --- a/forcer/forcer-aux.h +++ b/forcer/forcer-aux.h @@ -142,7 +142,7 @@ NTable,sparse,OneFill,`PREFIX'dotmaptabl(2); #do toponame={`?topolist'} #if `HASTOPO`toponame'' - L `NAME'`toponame' = `NAME'[M`toponame'] * M`toponame'; + L [`NAME'`toponame'] = `NAME'[M`toponame'] * M`toponame'; #ifdef `FORCERSTATS' * NOTE: Computing the complexity of integrals based on the difference of * indices to Z(1,...,1,0,...,0) requires information of each topology (the @@ -166,7 +166,7 @@ NTable,sparse,OneFill,`PREFIX'dotmaptabl(2); ModuleOption noparallel; .sort:begin `toponame'; #ifdef `ALLTIMING' - #$`oldn' = termsin_(`NAME'`toponame'); + #$`oldn' = termsin_([`NAME'`toponame']); #endif #ifdef `FORCERSTATS' #if `$`prefix'minindex' != 9999 @@ -180,11 +180,11 @@ NTable,sparse,OneFill,`PREFIX'dotmaptabl(2); #endif #call AfterReduce(`toponame') #if `HASTOPO`toponame'' - Hide `NAME'`toponame'; + Hide [`NAME'`toponame']; #redefine processedtopolist "`processedtopolist',`toponame'" #ifdef `ALLTIMING' #if `timer_' >= `MINTIME' - #$`n' = termsin_(`NAME'`toponame'); + #$`n' = termsin_([`NAME'`toponame']); #write <`NAME'.time> "\t {`timer_'/1000} sec. spent reducing `toponame' (`$`oldn'' -> `$`n'' terms)" #endif #reset timer @@ -199,18 +199,18 @@ NTable,sparse,OneFill,`PREFIX'dotmaptabl(2); `NAME', #do toponame={`processedtopolist'} #ifdef `toponame' - `NAME'`toponame', + [`NAME'`toponame'], #endif #enddo ; - L `NAME'tmp = `NAME'[1] + L [`NAME'tmp] = `NAME'[1] #do toponame={`processedtopolist'} #ifdef `toponame' - + `NAME'`toponame' + + [`NAME'`toponame'] #endif #enddo ; - #exchange `NAME',`NAME'tmp + #exchange `NAME',[`NAME'tmp] AB+ rat; ModuleOption noparallel; .sort:term merge with `nedge' edges; diff --git a/forcer/forcer-rules.h b/forcer/forcer-rules.h index 0e8d2f5..4ff5d86 100644 --- a/forcer/forcer-rules.h +++ b/forcer/forcer-rules.h @@ -314,9 +314,9 @@ endrepeat; * if we know the name of the input, merge all expressions .sort:Merge spectator `TOPO'; #ifdef `NAME' - Drop `NAME'`TOPO',F`TOPO'res; - L `NAME'tmp = `NAME'`TOPO' + F`TOPO'res; - #exchange `NAME'`TOPO',`NAME'tmp + Drop [`NAME'`TOPO'],F`TOPO'res; + L [`NAME'tmp] = [`NAME'`TOPO'] + F`TOPO'res; + #exchange [`NAME'`TOPO'],[`NAME'tmp] ModuleOption noparallel; .sort:spectator merge `TOPO'; #endif @@ -4631,7 +4631,7 @@ label 2; * the non-integer parts of indices are understood by `TOPO'. * * NOTE: Because of the current usage of spectators, the active expression must -* have a name `NAME'`TOPO'. +* have a name [`NAME'`TOPO']. * #procedure ReduceImpl2(TOPO,Z,N) #define Y "Y" @@ -4654,11 +4654,11 @@ label 2; #endswitch #ifndef `NOSPECTATORS' .sort:`TOPO'-pre_from_spectator; - #call FromSpectator(x`TOPO',`NAME'`TOPO'res,`NAME'`TOPO'res,`Y') + #call FromSpectator(x`TOPO',[`NAME'`TOPO']res,[`NAME'`TOPO']res,`Y') .sort:`TOPO'-from_spectator; - Drop `NAME'`TOPO',`NAME'`TOPO'res; - L `NAME'tmp = `NAME'`TOPO' + `NAME'`TOPO'res; - #exchange `NAME'`TOPO',`NAME'tmp + Drop [`NAME'`TOPO'],[`NAME'`TOPO']res; + L [`NAME'tmp] = [`NAME'`TOPO'] + [`NAME'`TOPO']res; + #exchange [`NAME'`TOPO'],[`NAME'tmp] ModuleOption noparallel; .sort:`TOPO'-merge_spectator; #endif