Conversation
|
I believe we need to restrict the parameter re-assigning (-> call-by-reference) for more parameters: specifically, bracketed variables I think my change works. The flows-from graph looks correct. @mrd , could I check in with you on this? |
|
I'm testing like so: module m
implicit none
contains
subroutine double(i, i2)
integer, intent(in) :: i
integer, intent(out) :: i2
print *, "entering double, i =", i
i2 = 2*i
print *, "leaving double, i =", i
end subroutine double
end module m
program overlapping_arg
use m, only: double
implicit none
integer :: j
j = 3
call double(j, j)
print *, "(1) in main, j =", j
call double(j, j)
print *, "(2) in main, j =", j
end program overlapping_argAnd running |
|
I ignored the named parameter feature that Fortran has! Almost finished re-jigging the parsers to properly handle that. (I don't think we look at named parameters in the analysis, so I'm not fixing anything there.) |
|
Pending while we resolve some potential issues with the |
Analysis.BBlock.perBlockis where the decision is made on how to create blocks fromcall()s. Previously, it would check to see if the expression was assignable: either a plain variable, or a subscript. If so, it would "re-assign" them (I'm not completely clear on this part). Now, we treat bracketed plain variables as non-assignable, figuring that they're used as call-by-value.Closes #203 .
TODO
perBlock: do same for the expression function call (pull the pattern out)