Commits

Harald Klimach committed 31d905a

Also allocate val in the vvect routines for invalid arguments with size 0

  • Participants
  • Parent commits f801ea3

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
+      ! In case of invalid arguments return 0-sized arrays.
+      ! (Equivalent of not found Lua tables.)
+      allocate(Val(0))
       allocate(ErrCode(0))
     end if
 
     if (valid_args) then
       call aot_top_get_val(val, ErrCode, maxlength, L, default)
     else
+      ! In case of invalid arguments return 0-sized arrays.
+      ! (Equivalent of not found Lua tables.)
+      allocate(Val(0))
       allocate(ErrCode(0))
     end if
 
     if (valid_args) then
       call aot_top_get_val(val, ErrCode, maxlength, L, default)
     else
+      ! In case of invalid arguments return 0-sized arrays.
+      ! (Equivalent of not found Lua tables.)
+      allocate(Val(0))
       allocate(ErrCode(0))
     end if
 
     if (valid_args) then
       call aot_top_get_val(val, ErrCode, maxlength, L, default)
     else
+      ! In case of invalid arguments return 0-sized arrays.
+      ! (Equivalent of not found Lua tables.)
+      allocate(Val(0))
       allocate(ErrCode(0))
     end if
 
     if (valid_args) then
       call aot_top_get_val(val, ErrCode, maxlength, L, default)
     else
+      ! In case of invalid arguments return 0-sized arrays.
+      ! (Equivalent of not found Lua tables.)
+      allocate(Val(0))
       allocate(ErrCode(0))
     end if
 

source/extdouble/aot_extdouble_vector_module.f90

     if (valid_args) then
       call aot_top_get_val(val, ErrCode, maxlength, L, default)
     else
+      ! In case of invalid arguments return 0-sized arrays.
+      ! (Equivalent of not found Lua tables.)
+      allocate(Val(0))
       allocate(ErrCode(0))
     end if
 

source/quadruple/aot_quadruple_vector_module.f90

     if (valid_args) then
       call aot_top_get_val(val, ErrCode, maxlength, L, default)
     else
+      ! In case of invalid arguments return 0-sized arrays.
+      ! (Equivalent of not found Lua tables.)
+      allocate(Val(0))
       allocate(ErrCode(0))
     end if