on master help sign in
Stop getArgs from crashing executor
360bbdaDavid Raymond Christiansen
src/Idris/Core/Execute.hs+7
@@ -320,6 +320,13 @@ execApp' env ctxt (EP _ fp _) (_:fn:EConstant (Str s):rest)
320 = let res = ioWrap . EConstant . I $ 0
320 = let res = ioWrap . EConstant . I $ 0
321 in execApp' env ctxt res (tail rest)
321 in execApp' env ctxt res (tail rest)
322
322
323+-- Right now, there's no way to send command-line arguments to the executor,
324+-- so just return 0.
325+execApp' env ctxt (EP _ fp _) (_:fn:rest)
326+ | fp == mkfprim,
327+ Just (FFun "idris_numArgs" _ _) <- foreignFromTT fn
328+ = let res = ioWrap . EConstant . I $ 0
329+ in execApp' env ctxt res (tail rest)
323-- Throw away the 'World' argument to the foreign function
330-- Throw away the 'World' argument to the foreign function
324
331
325execApp' env ctxt f@(EP _ fp _) args@(ty:fn:xs) | fp == mkfprim
332execApp' env ctxt f@(EP _ fp _) args@(ty:fn:xs) | fp == mkfprim