You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a varref references a param declaration, neither of the nodes have a defined bitWidth value. This does not happen if the varref references other types of declarations. Replicate with the aspect:
import weaver.WeaverJps;
aspectdef Test
for (var v of Query.search("varref")) {
println("varref: " + v.code + " - " + v.bitWidth +
" | decl: " + v.decl.code + " - " + v.decl.bitWidth);
}
end
And with the input source code:
void foo(int A[100], int B) {
for (int i = 0; i < 100; i++) {
A[i] = A[i] + B;
}
}
The output is:
varref: i - 32 | decl: int i = 0 - 32
varref: i - 32 | decl: int i = 0 - 32
varref: A - undefined | decl: int A[100] - undefined
varref: i - 32 | decl: int i = 0 - 32
varref: A - undefined | decl: int A[100] - undefined
varref: i - 32 | decl: int i = 0 - 32
varref: B - 32 | decl: int B - 32
The text was updated successfully, but these errors were encountered:
If a
varref
references aparam
declaration, neither of the nodes have a definedbitWidth
value. This does not happen if thevarref
references other types of declarations. Replicate with the aspect:And with the input source code:
The output is:
The text was updated successfully, but these errors were encountered: