[OCaml] Fix segfaults when too few arguments are passed to a function

Prevent segfaults when too few arguments are passed to a function.

Length checks are not needed for the wrappers of overloaded
functions -- the generated dispatch function already checks.

Add default_args_runme.ml.

Fix minor errors in some runtime tests.  Extra args were being passed
in some cases.
This commit is contained in:
Zackery Spytz 2019-02-15 01:17:15 -07:00
commit 071803f000
8 changed files with 77 additions and 9 deletions

View file

@ -18,7 +18,7 @@ let _ = print_endline "----------------------------------------"
let callback = new_Callback '()
let _ = caller -> "setCallback" (callback)
let _ = caller -> "call" ()
let _ = caller -> "delCallback" (0)
let _ = caller -> "delCallback" ()
let _ = print_endline "\nAdding and calling an OCaml callback"
let _ = print_endline "------------------------------------"
@ -26,5 +26,5 @@ let _ = print_endline "------------------------------------"
let callback = new_derived_object new_Callback (new_OCamlCallback) '()
let _ = caller -> "setCallback" (callback)
let _ = caller -> "call" ()
let _ = caller -> "delCallback" (0)
let _ = caller -> "delCallback" ()
let _ = print_endline "\nOCaml exit"