Skip to content

Commit

Permalink
Parse DISubprogram's spFlags correctly on LLVM 8.0+
Browse files Browse the repository at this point in the history
This corrects an inadvertent mistake introduced in #137 where the order of
cases was reversed.

Fixes #211.
  • Loading branch information
RyanGlScott committed Apr 3, 2023
1 parent 0b04f95 commit 6f20a16
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Data/LLVM/BitCode/IR/Metadata.hs
Original file line number Diff line number Diff line change
Expand Up @@ -705,9 +705,9 @@ parseMetadataEntry vt mt pm (fromEntry -> Just r) =

(diFlags0, spFlags0) <-
if hasSPFlags then
(,) <$> parseField r (11 + 2) numeric <*> pure 0
else
(,) <$> parseField r 11 numeric <*> parseField r 9 numeric
else
(,) <$> parseField r (11 + 2) numeric <*> pure 0

let diFlagMainSubprogram = bit 21 :: Word32
hasOldMainSubprogramFlag = (diFlags0 .&. diFlagMainSubprogram) /= 0
Expand Down

0 comments on commit 6f20a16

Please sign in to comment.