-
Notifications
You must be signed in to change notification settings - Fork 15
Mixing of indices of lvalue when using for
generators in rvalue
#138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasion 8000 ally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@JunaidJameel the closest (complete) actor example containing your action is:
The C for the action in question is: static void untagged_1() {
i32 offset1;
u8 tempList[16];
i32 i;
u8 tmp_pt;
i32 i0;
u8 tmp_pt0;
offset1 = 64;
i = offset1;
while (i <= offset1 + 15) {
tmp_pt = pt[i];
tempList[i - 64] = tmp_pt;
i = i + 1;
}
i0 = 0;
while (i0 <= 15) {
tmp_pt0 = pt[offset1 + i0];
i0 = i0 + 1;
}
// Update ports indexes
} Which doesn't match your C output. Could you provide a complete actor that contains the action in question, so that I could replicate the C output you are getting? |
Hi @robstewart57 , Please checkout to branch tta_experimental, commit: 7312522 and then go to this design:
Note that, After compiling, I see the following code for the action's body:
Note this For the rest of the while loops, also note how indices ( We can also produce the problem similar to
I hope this would help you reproduce the problems. PS: If you would like to run this design, no input is needed. Just compile and run. You will see errors in output if you happen to test with the above code for output ports. In case it is important, I am on commit |
for
generators in rvalue
Given the following action:
The C-backend generates the following code for this two list generations:
In both cases, index i (which is the index of the generator for) has also been used to populate the lvalue lists (tempList, tokensOP). This usage is fine, when the indexing in the for generator is starting from 0. But when the for generator is starting with some non-zero positive number, the index i mistakenly refers to a wrong location in the lvalue list, hence results in index of out bound exceptions.
The text was updated successfully, but these errors were encountered: