Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@tueda
Copy link
Collaborator

@tueda tueda commented Mar 6, 2024

Try to fix #268.

I'm still not sure why EATTENSOR is called so (maybe there was a certain reason 21 years ago).

@jodavies
Copy link
Collaborator

jodavies commented Mar 6, 2024

I don't follow this. Why does EATTENSOR need "passing in" at all? The define is active inside these functions of course.

Shouldn't f5c061e#diff-dfad395d67eb6654e019817a74f727d798e04807b660529206715a8f3b141503R1565 just be if (newnumber) now?

@tueda
Copy link
Collaborator Author

tueda commented Mar 6, 2024

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_.

@jodavies
Copy link
Collaborator

jodavies commented Mar 6, 2024

OK I see, I misinterpreted it as some kind of limit on the number of arguments that can be in the pattern.

The EATTENSOR flag is now passed to CheckWild()/AddWild() via "type"
instead of "newnumber". Fixes form-dev#268.
@tueda
Copy link
Collaborator Author

tueda commented Mar 8, 2024

Added 2 tests for #268.

@tueda tueda merged commit 029a647 into form-dev:master Mar 15, 2024
@tueda tueda deleted the fix-268 branch May 4, 2024 02:23
@jodavies
Copy link
Collaborator

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

@tueda
Copy link
Collaborator Author

tueda commented May 14, 2024

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)

@tueda
Copy link
Collaborator Author

tueda commented May 14, 2024

I really don't understand why I overlooked this line.

https://github.com/vermaseren/form/blob/e58ebd3f344ad3a6e3ae5393be3f20d17a79192f/sources/function.c#L1056

Definitely, we need more tests... color.h is a good candidate, indeed.

@tueda tueda mentioned this pull request May 14, 2024
tueda added a commit to tueda/form that referenced this pull request May 21, 2024
tueda added a commit that referenced this pull request May 21, 2024
tueda added a commit that referenced this pull request May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Invalid read in Normalize

2 participants