Commits

Harald Klimach committed f801ea3

Access ErrCode only after it was allocated and return it with length of 0,
if there was no matching array in the Lua script due to invalid argument
combination.

  • Participants
  • Parent commits f9df903

Comments (0)

Files changed (3)

source/aot_vector_module.f90

     if (valid_args) then
       call aot_top_get_val(val, ErrCode, maxlength, L, default)
     else
-      ErrCode = ibSet(0, aoterr_NonExistent)
-      ErrCode = ibSet(ErrCode, aoterr_Fatal)
+      allocate(ErrCode(0))
     end if
 
   end subroutine get_table_real_vvect
     if (valid_args) then
       call aot_top_get_val(val, ErrCode, maxlength, L, default)
     else
-      ErrCode = ibSet(0, aoterr_NonExistent)
-      ErrCode = ibSet(ErrCode, aoterr_Fatal)
+      allocate(ErrCode(0))
     end if
 
   end subroutine get_table_double_vvect
     if (valid_args) then
       call aot_top_get_val(val, ErrCode, maxlength, L, default)
     else
-      ErrCode = ibSet(0, aoterr_NonExistent)
-      ErrCode = ibSet(ErrCode, aoterr_Fatal)
+      allocate(ErrCode(0))
     end if
 
   end subroutine get_table_integer_vvect
     if (valid_args) then
       call aot_top_get_val(val, ErrCode, maxlength, L, default)
     else
-      ErrCode = ibSet(0, aoterr_NonExistent)
-      ErrCode = ibSet(ErrCode, aoterr_Fatal)
+      allocate(ErrCode(0))
     end if
 
   end subroutine get_table_long_vvect
     if (valid_args) then
       call aot_top_get_val(val, ErrCode, maxlength, L, default)
     else
-      ErrCode = ibSet(0, aoterr_NonExistent)
-      ErrCode = ibSet(ErrCode, aoterr_Fatal)
+      allocate(ErrCode(0))
     end if
 
   end subroutine get_table_logical_vvect
     integer :: vect_lb
     integer :: iComp
 
-    ErrCode = 0
-
     ! Try to interpret the top entry on the stack as a table
     vect_handle = aot_table_top(L=L)
     table_len = aot_table_length(L=L, thandle=vect_handle)
       allocate(val(vect_len))
       allocate(errCode(vect_len))
 
+      ErrCode = 0
+
       ! Only if the vector table actually exists, and has at least one entry,
       ! this parsing has to be done.
       if (present(default).and.(def_len > 0)) then
     integer :: vect_lb
     integer :: iComp
 
-    ErrCode = 0
-
     ! Try to interpret the top entry on the stack as a table
     vect_handle = aot_table_top(L=L)
     table_len = aot_table_length(L=L, thandle=vect_handle)
       allocate(val(vect_len))
       allocate(errCode(vect_len))
 
+      ErrCode = 0
+
       ! Only if the vector table actually exists, and has at least one entry,
       ! this parsing has to be done.
       if (present(default).and.(def_len > 0)) then
     integer :: vect_lb
     integer :: iComp
 
-    ErrCode = 0
-
     ! Try to interpret the top entry on the stack as a table
     vect_handle = aot_table_top(L=L)
     table_len = aot_table_length(L=L, thandle=vect_handle)
       allocate(val(vect_len))
       allocate(errCode(vect_len))
 
+      ErrCode = 0
+
       ! Only if the vector table actually exists, and has at least one entry,
       ! this parsing has to be done.
       if (present(default).and.(def_len > 0)) then
     integer :: vect_lb
     integer :: iComp
 
-    ErrCode = 0
-
     ! Try to interpret the top entry on the stack as a table
     vect_handle = aot_table_top(L=L)
     table_len = aot_table_length(L=L, thandle=vect_handle)
       allocate(val(vect_len))
       allocate(errCode(vect_len))
 
+      ErrCode = 0
+
       ! Only if the vector table actually exists, and has at least one entry,
       ! this parsing has to be done.
       if (present(default).and.(def_len > 0)) then
     integer :: vect_lb
     integer :: iComp
 
-    ErrCode = 0
-
     ! Try to interpret the top entry on the stack as a table
     vect_handle = aot_table_top(L=L)
     table_len = aot_table_length(L=L, thandle=vect_handle)
       allocate(val(vect_len))
       allocate(errCode(vect_len))
 
+      ErrCode = 0
+
       ! Only if the vector table actually exists, and has at least one entry,
       ! this parsing has to be done.
       if (present(default).and.(def_len > 0)) then

source/extdouble/aot_extdouble_vector_module.f90

     if (valid_args) then
       call aot_top_get_val(val, ErrCode, maxlength, L, default)
     else
-      ErrCode = ibSet(0, aoterr_NonExistent)
-      ErrCode = ibSet(ErrCode, aoterr_Fatal)
+      allocate(ErrCode(0))
     end if
 
   end subroutine get_table_extdouble_vvect
       allocate(val(vect_len))
       allocate(errCode(vect_len))
 
+      ErrCode = 0
+
       ! Only if the vector table actually exists, and has at least one entry,
       ! this parsing has to be done.
       if (present(default).and.(def_len > 0)) then

source/quadruple/aot_quadruple_vector_module.f90

     if (valid_args) then
       call aot_top_get_val(val, ErrCode, maxlength, L, default)
     else
-      ErrCode = ibSet(0, aoterr_NonExistent)
-      ErrCode = ibSet(ErrCode, aoterr_Fatal)
+      allocate(ErrCode(0))
     end if
 
   end subroutine get_table_quadruple_vvect
       allocate(val(vect_len))
       allocate(errCode(vect_len))
 
+      ErrCode = 0
+
       ! Only if the vector table actually exists, and has at least one entry,
       ! this parsing has to be done.
       if (present(default).and.(def_len > 0)) then