Commits

Kannan Masilamani committed bca9a13

Bugfix in setting default for aot vector from top if table_len = 0 and default is present

  • Participants
  • Parent commits ad6e532

Comments (0)

Files changed (1)

File source/aot_vector_module.f90

 
     integer :: vect_handle
     integer :: table_len, vect_len, def_len
-    integer :: vect_lb, minub
+    integer :: vect_lb
     integer :: iComp
 
     ! Try to interpret it as table.
       ! No vector definition found in the Lua script, use the default.
       ErrCode = ibSet(ErrCode, aoterr_NonExistent)
       if (present(default)) then
-        minub = min(vect_len, def_len)
-        val(:minub) = default(:minub)
-        if (minub < vect_len) then
-          ErrCode(minub+1:) = ibSet(ErrCode(minub+1:), aoterr_Fatal)
+        val(:def_len) = default(:def_len)
+        if (def_len < vect_len) then
+          ErrCode(def_len+1:) = ibSet(ErrCode(def_len+1:), aoterr_Fatal)
         end if
       else
         ! No vector definition in the Lua script and no default provided.
 
     integer :: vect_handle
     integer :: table_len, vect_len, def_len
-    integer :: vect_lb, minub
+    integer :: vect_lb
     integer :: iComp
 
     ! Try to interpret it as table.
       ! No vector definition found in the Lua script, use the default.
       ErrCode = ibSet(ErrCode, aoterr_NonExistent)
       if (present(default)) then
-        minub = min(vect_len, def_len)
-        val(:minub) = default(:minub)
-        if (minub < vect_len) then
-          ErrCode(minub+1:) = ibSet(ErrCode(minub+1:), aoterr_Fatal)
+        val(:def_len) = default(:def_len)
+        if (def_len < vect_len) then
+          ErrCode(def_len+1:) = ibSet(ErrCode(def_len+1:), aoterr_Fatal)
         end if
       else
         ! No vector definition in the Lua script and no default provided.
 
     integer :: vect_handle
     integer :: table_len, vect_len, def_len
-    integer :: vect_lb, minub
+    integer :: vect_lb
     integer :: iComp
 
     ! Try to interpret it as table.
       ! No vector definition found in the Lua script, use the default.
       ErrCode = ibSet(ErrCode, aoterr_NonExistent)
       if (present(default)) then
-        minub = min(vect_len, def_len)
-        val(:minub) = default(:minub)
-        if (minub < vect_len) then
-          ErrCode(minub+1:) = ibSet(ErrCode(minub+1:), aoterr_Fatal)
+        def_len = def_len
+        val(:def_len) = default(:def_len)
+        if (def_len < vect_len) then
+          ErrCode(def_len+1:) = ibSet(ErrCode(def_len+1:), aoterr_Fatal)
         end if
       else
         ! No vector definition in the Lua script and no default provided.
 
     integer :: vect_handle
     integer :: table_len, vect_len, def_len
-    integer :: vect_lb, minub
+    integer :: vect_lb
     integer :: iComp
 
     ! Try to interpret it as table.
       ! No vector definition found in the Lua script, use the default.
       ErrCode = ibSet(ErrCode, aoterr_NonExistent)
       if (present(default)) then
-        minub = min(vect_len, def_len)
-        val(:minub) = default(:minub)
-        if (minub < vect_len) then
-          ErrCode(minub+1:) = ibSet(ErrCode(minub+1:), aoterr_Fatal)
+        val(:def_len) = default(:def_len)
+        if (def_len < vect_len) then
+          ErrCode(def_len+1:) = ibSet(ErrCode(def_len+1:), aoterr_Fatal)
         end if
       else
         ! No vector definition in the Lua script and no default provided.
 
     integer :: vect_handle
     integer :: table_len, vect_len, def_len
-    integer :: vect_lb, minub
+    integer :: vect_lb
     integer :: iComp
 
     ! Try to interpret it as table.
       ! No vector definition found in the Lua script, use the default.
       ErrCode = ibSet(ErrCode, aoterr_NonExistent)
       if (present(default)) then
-        minub = min(vect_len, def_len)
-        val(:minub) = default(:minub)
-        if (minub < vect_len) then
-          ErrCode(minub+1:) = ibSet(ErrCode(minub+1:), aoterr_Fatal)
+        val(:def_len) = default(:def_len)
+        if (def_len < vect_len) then
+          ErrCode(def_len+1:) = ibSet(ErrCode(def_len+1:), aoterr_Fatal)
         end if
       else
         ! No vector definition in the Lua script and no default provided.