Skip to content

Commit 2e17b76

Browse files
committed
Use aaload instead of getfield for accessing elements in a list.
Previously, the code used `getfield` to access elements in a list. While this is not incorrect, this change made the code more consistent with `functools.xml`, which uses `aaload`.
1 parent 0674249 commit 2e17b76

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

com.ibm.wala.cast.python.ml/data/tensorflow.xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1048,7 +1048,8 @@
10481048
<!-- https://www.tensorflow.org/versions/r2.9/api_docs/python/tf/data/Dataset#choose_from_datasets -->
10491049
<method name="do" descriptor="()LRoot;" numArgs="3" paramNames="datasets choice_dataset stop_on_empty_dataset">
10501050
<!-- Return the first one in the list. -->
1051-
<getfield class="Llist" field="0" fieldType="Ltensorflow/data/Dataset" ref="datasets" def="x" />
1051+
<constant name="l" type="int" value="0" />
1052+
<aaload index="l" type="Ltensorflow/data/Dataset" ref="datasets" def="x" />
10521053
<return value="x" />
10531054
</method>
10541055
</class>
@@ -1108,7 +1109,8 @@
11081109
<package name="tensorflow/distribute/run">
11091110
<class name="run" allocatable="true">
11101111
<method name="do" descriptor="()LRoot;" numArgs="3">
1111-
<getfield class="LRoot" field="0" fieldType="LRoot" ref="arg2" def="x" />
1112+
<constant name="l" type="int" value="0" />
1113+
<aaload index="l" type="LRoot" ref="arg2" def="x" />
11121114
<call class="LRoot" name="do" descriptor="()LRoot;" type="virtual" arg0="arg1" arg1="x" numArgs="2" def="v" />
11131115
<return value="v" />
11141116
</method>

0 commit comments

Comments
 (0)