Closed tueda closed 8 months ago
I don't follow this. Why does EATTENSOR need "passing in" at all? The define is active inside these functions of course.
Shouldn't https://github.com/vermaseren/form/pull/490/commits/f5c061e1c944577e1953bd68210d73d664c4dba3#diff-dfad395d67eb6654e019817a74f727d798e04807b660529206715a8f3b141503R1565 just be if (newnumber)
now?
There exist calls of CheckWild()
/AddWild()
with ARGTOARG
and ARGTOARG|EATTENSOR
. We need both. I guess ARGTOARG
is for ?a
and ARGTOARG
with EATTENSOR
is for nargs_
.
OK I see, I misinterpreted it as some kind of limit on the number of arguments that can be in the pattern.
Added 2 tests for https://github.com/vermaseren/form/issues/268.
This one has caused a regression actually, here is an example which is the first thing color.h
does (we should put a variety of color.h tests in the CI...):
Symbol NA;
Dimension NA;
AutoDeclare Index cOli,cOlj,cOlk,cOln;
Tensor T;
Index j5,j7,ii1;
Local test = T(j5,j7,ii1)*T(j7,j5,ii1);
repeat id T(cOli1?,cOli2?,?a)*T(cOli2?,cOli3?,?b) = T(cOli1,cOli3,?a,?b);
.end
This terminates with
Illegal substitution of argument field in tensor
Good catch, thanks!
A somewhat minimized example that gives Vargrind errors is:
T t;
I i1,i2;
L F = t(i1,i2)*t;
id t(i1?,?a) * t(i2?,?b) = 1;
.end
==199135== Conditional jump or move depends on uninitialised value(s)
==199135== at 0x239D62: AddWild (wildcard.c:1571)
==199135== by 0x15BDCC: MatchFunction (function.c:1056)
==199135== by 0x15D77C: ScanFunctions (function.c:1775)
==199135== by 0x15967E: FindRest (findpat.c:1133)
==199135== by 0x1ACCCE: TestMatch (pattern.c:346)
==199135== by 0x1E00F5: Generator (proces.c:3964)
==199135== by 0x1E093C: Generator (proces.c:4216)
==199135== by 0x1E1FCA: Processor (proces.c:406)
==199135== by 0x150E42: DoExecute (execute.c:858)
==199135== by 0x17C558: ExecModule (module.c:291)
==199135== by 0x1D6C1F: PreProcessor (pre.c:1041)
==199135== by 0x21451B: main (startup.c:1690)
==199135==
==199135== Conditional jump or move depends on uninitialised value(s) ==199135== at 0x239D52: AddWild (wildcard.c:1571)
==199135== by 0x15BDCC: MatchFunction (function.c:1056)
==199135== by 0x15D77C: ScanFunctions (function.c:1775)
==199135== by 0x15967E: FindRest (findpat.c:1133)
==199135== by 0x1ACCCE: TestMatch (pattern.c:346)
==199135== by 0x1E00F5: Generator (proces.c:3964)
==199135== by 0x1E093C: Generator (proces.c:4216)
==199135== by 0x1E1FCA: Processor (proces.c:406)
==199135== by 0x150E42: DoExecute (execute.c:858)
==199135== by 0x17C558: ExecModule (module.c:291)
==199135== by 0x1D6C1F: PreProcessor (pre.c:1041)
==199135== by 0x21451B: main (startup.c:1690)
I really don't understand why I overlooked this line.
Definitely, we need more tests... color.h
is a good candidate, indeed.
Try to fix #268.
I'm still not sure why
EATTENSOR
is called so (maybe there was a certain reason 21 years ago).