Commit 74b46a5d authored by simonmar's avatar simonmar
Browse files

[project @ 2003-03-17 14:47:47 by simonmar]

Haskell quiz:  what should this program do?

  main = return undefined

answer: run to completion and exit successfully.  GHC erroneously
evaluates the returned value from main, which causes this example to
fail with an uncaught exception (the evaluation is even done outside
of the main exception handler!).
parent 1b5c8ce0
/* -----------------------------------------------------------------------------
* $Id: Main.c,v 1.35 2002/07/18 06:05:30 sof Exp $
* $Id: Main.c,v 1.36 2003/03/17 14:47:47 simonmar Exp $
*
* (c) The GHC Team 1998-2000
*
......@@ -84,7 +84,7 @@ int main(int argc, char *argv[])
fprintf(stderr, "==== [%x] Main Thread Started ...\n", mytid));
/* ToDo: Dump event for the main thread */
status = rts_mainEvalIO((HaskellObj)mainIO_closure, NULL);
status = rts_mainLazyIO((HaskellObj)mainIO_closure, NULL);
} else {
/* Just to show we're alive */
IF_PAR_DEBUG(verbose,
......@@ -99,12 +99,12 @@ int main(int argc, char *argv[])
# elif defined(GRAN)
/* ToDo: Dump event for the main thread */
status = rts_mainEvalIO(mainIO_closure, NULL);
status = rts_mainLazyIO(mainIO_closure, NULL);
# else /* !PAR && !GRAN */
/* ToDo: want to start with a larger stack size */
status = rts_mainEvalIO((HaskellObj)mainIO_closure, NULL);
status = rts_mainLazyIO((HaskellObj)mainIO_closure, NULL);
# endif /* !PAR && !GRAN */
......
/* -----------------------------------------------------------------------------
* $Id: Schedule.h,v 1.37 2003/01/25 15:54:50 wolfgang Exp $
* $Id: Schedule.h,v 1.38 2003/03/17 14:47:48 simonmar Exp $
*
* (c) The GHC Team 1998-1999
*
......@@ -151,7 +151,7 @@ extern nat rts_n_waiting_tasks;
StgInt forkProcess(StgTSO *tso);
extern SchedulerStatus rts_mainEvalIO(HaskellObj p, /*out*/HaskellObj *ret);
extern SchedulerStatus rts_mainLazyIO(HaskellObj p, /*out*/HaskellObj *ret);
/* Called by shutdown_handler(). */
......
/* -----------------------------------------------------------------------------
* $Id: Weak.c,v 1.27 2003/01/25 15:54:50 wolfgang Exp $
* $Id: Weak.c,v 1.28 2003/03/17 14:47:48 simonmar Exp $
*
* (c) The GHC Team, 1998-1999
*
......@@ -48,7 +48,7 @@ finalizeWeakPointersNow(void)
rts_unlock();
rts_lock();
#else
rts_mainEvalIO(w->finalizer,NULL);
rts_mainLazyIO(w->finalizer,NULL);
#endif
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment