Has_Access is using a hash indexed by
current_function which constructed from the thorn name and the function name in the
cFunctionData passed to
CallFunction. However for a schedule statement:
schedule TestReadWrite_TestC_A as TestReadWrite_TestC_A_2nd
this yields a string “TestReadWrite_TestC_A::TestReadWrite_TestC_A” which is not sufficient to distinguish the two different schedule blocks.
There does not seem to be anything in
cFunctionData that would reveal the alias used. However there seems to be no need for the map that
hasAccess uses anyway.
cFunctiondata does contain the
RDWR array and
hasAccess could just search that array. Assuming the array is sorted by varindex (easily arranged when buidling it) then a binary search for an integer in an array of size of 10 or so (guessing the typically accessible number of variables for a scheduled function) rather than a binary tree walk in the map using a hundred of schedule items and a string compare.