I use the built-in assembly massively in a project where I need to call functions with an unknown number of arguments at compile time, and while I myself can make it work, sometimes on linux (in windows I don’t remember this problem) strange things like this:
If I have something like
for(int i = 1; i >= 0; i--)
asm("push %0"::"m"(someArray[i]));
He works.
If i have
for(int i = this->someVar; i >= 0; i--)
asm("push %0"::"m"(someArray[i]));
and I guarantee with my life that someVar holds the value 1, it causes a segmentation error.
Also if i have
int x = 1;
for(int i = x; i >= 0; i--)
asm("push %0"::"m"(someArray[i]));
it works but
int x = this->someVar;
for(int i = x; i >= 0; i--)
asm("push %0"::"m"(someArray[i]));
no.
Besides, and also strange, I can say that although in some functions I have no problems doing this in others that I have, everything is in the same object.
If someone can tell me some information that can clarify what the problem is, I would appreciate it.
, for, , .
"volatile", .