Commit 83d69dca authored by Ben Gamari's avatar Ben Gamari Committed by Ben Gamari

Don't barf() on failures in loadArchive()

This patch replaces calls to barf() in loadArchive() with proper
error handling.

Test Plan: GHC CI

Reviewers: rwbarton, erikd, hvr, austin, simonmar, bgamari

Reviewed By: bgamari

Subscribers: thomie

Tags: #ghc

Differential Revision: https://phabricator.haskell.org/D2652

GHC Trac Issues: #12388
parent d70d452a
......@@ -267,13 +267,13 @@ TICK_VAR(2)
Assertions and Debuggery
-------------------------------------------------------------------------- */
#define IF_RTSFLAGS(c,s) if (RtsFlags.c) { s; }
#define IF_RTSFLAGS(c,s) if (RtsFlags.c) { s; } doNothing()
#ifdef DEBUG
#if IN_STG_CODE
#define IF_DEBUG(c,s) if (RtsFlags[0].DebugFlags.c) { s; }
#define IF_DEBUG(c,s) if (RtsFlags[0].DebugFlags.c) { s; } doNothing()
#else
#define IF_DEBUG(c,s) if (RtsFlags.DebugFlags.c) { s; }
#define IF_DEBUG(c,s) if (RtsFlags.DebugFlags.c) { s; } doNothing()
#endif
#else
#define IF_DEBUG(c,s) doNothing()
......
......@@ -259,8 +259,6 @@ extern /*Str*/HashTable *symhash;
#define USE_CONTIGUOUS_MMAP 0
#endif
#include "EndPrivate.h"
HsInt isAlreadyLoaded( pathchar *path );
HsInt loadOc( ObjectCode* oc );
ObjectCode* mkOc( pathchar *path, char *image, int imageSize,
......@@ -268,10 +266,6 @@ ObjectCode* mkOc( pathchar *path, char *image, int imageSize,
int misalignment
);
#ifdef darwin_HOST_OS
int machoGetMisalignment( FILE * f );
#endif /* darwin_HOST_OS */
#if defined (mingw32_HOST_OS)
/* We use myindex to calculate array addresses, rather than
simply doing the normal subscript thing. That's because
......@@ -313,4 +307,5 @@ char *cstring_from_section_name(
#define MAP_ANONYMOUS 0
#endif
#include "EndPrivate.h"
#endif /* LINKERINTERNALS_H */
This diff is collapsed.
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