[commit: ghc] ghc-8.6: rts/MachO: Iterate through N (all) symbols, not M external symbols (11fd7df)

git at git.haskell.org git at git.haskell.org
Thu Nov 22 21:56:10 UTC 2018


Repository : ssh://git@git.haskell.org/ghc

On branch  : ghc-8.6
Link       : http://ghc.haskell.org/trac/ghc/changeset/11fd7df565897fb98cda9273dab28ccc654a6d95/ghc

>---------------------------------------------------------------

commit 11fd7df565897fb98cda9273dab28ccc654a6d95
Author: Dario Bertini <berdario at google.com>
Date:   Fri Nov 16 15:49:37 2018 +0100

    rts/MachO: Iterate through N (all) symbols, not M external symbols
    
    Fixes #15105
    
    (cherry picked from commit 254890855ee04762cc0392da19e0c42fc039a718)


>---------------------------------------------------------------

11fd7df565897fb98cda9273dab28ccc654a6d95
 rts/linker/MachO.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/rts/linker/MachO.c b/rts/linker/MachO.c
index b5caa7b..053a45d 100644
--- a/rts/linker/MachO.c
+++ b/rts/linker/MachO.c
@@ -1660,7 +1660,7 @@ ocGetNames_MachO(ObjectCode* oc)
     commonCounter = (unsigned long)commonStorage;
 
     if (oc->info->symCmd) {
-        for (int i = 0; i < oc->n_symbols; i++) {
+        for (size_t i = 0; i < oc->info->n_macho_symbols; i++) {
             SymbolName* nm = oc->info->macho_symbols[i].name;
             MachONList *nlist = &oc->info->nlist[i];
             if((nlist->n_type & N_TYPE) == N_UNDF



More information about the ghc-commits mailing list