Skip to content

Commit 8d7b0a2

Browse files
committed
fix: crash with square-bracketed names (benruijl#1)
Close benruijl#1
1 parent 68a30bf commit 8d7b0a2

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

forcer/forcer-aux.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ NTable,sparse,OneFill,`PREFIX'dotmaptabl(2);
142142

143143
#do toponame={`?topolist'}
144144
#if `HASTOPO`toponame''
145-
L `NAME'`toponame' = `NAME'[M`toponame'] * M`toponame';
145+
L [`NAME'`toponame'] = `NAME'[M`toponame'] * M`toponame';
146146
#ifdef `FORCERSTATS'
147147
* NOTE: Computing the complexity of integrals based on the difference of
148148
* indices to Z(1,...,1,0,...,0) requires information of each topology (the
@@ -166,7 +166,7 @@ NTable,sparse,OneFill,`PREFIX'dotmaptabl(2);
166166
ModuleOption noparallel;
167167
.sort:begin `toponame';
168168
#ifdef `ALLTIMING'
169-
#$`oldn' = termsin_(`NAME'`toponame');
169+
#$`oldn' = termsin_([`NAME'`toponame']);
170170
#endif
171171
#ifdef `FORCERSTATS'
172172
#if `$`prefix'minindex' != 9999
@@ -180,11 +180,11 @@ NTable,sparse,OneFill,`PREFIX'dotmaptabl(2);
180180
#endif
181181
#call AfterReduce(`toponame')
182182
#if `HASTOPO`toponame''
183-
Hide `NAME'`toponame';
183+
Hide [`NAME'`toponame'];
184184
#redefine processedtopolist "`processedtopolist',`toponame'"
185185
#ifdef `ALLTIMING'
186186
#if `timer_' >= `MINTIME'
187-
#$`n' = termsin_(`NAME'`toponame');
187+
#$`n' = termsin_([`NAME'`toponame']);
188188
#write <`NAME'.time> "\t {`timer_'/1000} sec. spent reducing `toponame' (`$`oldn'' -> `$`n'' terms)"
189189
#endif
190190
#reset timer
@@ -199,18 +199,18 @@ NTable,sparse,OneFill,`PREFIX'dotmaptabl(2);
199199
`NAME',
200200
#do toponame={`processedtopolist'}
201201
#ifdef `toponame'
202-
`NAME'`toponame',
202+
[`NAME'`toponame'],
203203
#endif
204204
#enddo
205205
;
206-
L `NAME'tmp = `NAME'[1]
206+
L [`NAME'tmp] = `NAME'[1]
207207
#do toponame={`processedtopolist'}
208208
#ifdef `toponame'
209-
+ `NAME'`toponame'
209+
+ [`NAME'`toponame']
210210
#endif
211211
#enddo
212212
;
213-
#exchange `NAME',`NAME'tmp
213+
#exchange `NAME',[`NAME'tmp]
214214
AB+ rat;
215215
ModuleOption noparallel;
216216
.sort:term merge with `nedge' edges;

forcer/forcer-rules.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -314,9 +314,9 @@ endrepeat;
314314
* if we know the name of the input, merge all expressions
315315
.sort:Merge spectator `TOPO';
316316
#ifdef `NAME'
317-
Drop `NAME'`TOPO',F`TOPO'res;
318-
L `NAME'tmp = `NAME'`TOPO' + F`TOPO'res;
319-
#exchange `NAME'`TOPO',`NAME'tmp
317+
Drop [`NAME'`TOPO'],F`TOPO'res;
318+
L [`NAME'tmp] = [`NAME'`TOPO'] + F`TOPO'res;
319+
#exchange [`NAME'`TOPO'],[`NAME'tmp]
320320
ModuleOption noparallel;
321321
.sort:spectator merge `TOPO';
322322
#endif
@@ -4631,7 +4631,7 @@ label 2;
46314631
* the non-integer parts of indices are understood by `TOPO'.
46324632
*
46334633
* NOTE: Because of the current usage of spectators, the active expression must
4634-
* have a name `NAME'`TOPO'.
4634+
* have a name [`NAME'`TOPO'].
46354635
*
46364636
#procedure ReduceImpl2(TOPO,Z,N)
46374637
#define Y "Y"
@@ -4654,11 +4654,11 @@ label 2;
46544654
#endswitch
46554655
#ifndef `NOSPECTATORS'
46564656
.sort:`TOPO'-pre_from_spectator;
4657-
#call FromSpectator(x`TOPO',`NAME'`TOPO'res,`NAME'`TOPO'res,`Y')
4657+
#call FromSpectator(x`TOPO',[`NAME'`TOPO']res,[`NAME'`TOPO']res,`Y')
46584658
.sort:`TOPO'-from_spectator;
4659-
Drop `NAME'`TOPO',`NAME'`TOPO'res;
4660-
L `NAME'tmp = `NAME'`TOPO' + `NAME'`TOPO'res;
4661-
#exchange `NAME'`TOPO',`NAME'tmp
4659+
Drop [`NAME'`TOPO'],[`NAME'`TOPO']res;
4660+
L [`NAME'tmp] = [`NAME'`TOPO'] + [`NAME'`TOPO']res;
4661+
#exchange [`NAME'`TOPO'],[`NAME'tmp]
46624662
ModuleOption noparallel;
46634663
.sort:`TOPO'-merge_spectator;
46644664
#endif

0 commit comments

Comments
 (0)