Harald Klimach avatar Harald Klimach committed 31d905a

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

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
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.