From 7229033e427b4ec1668ef0dcbf70cd17f8c4937d Mon Sep 17 00:00:00 2001 From: krangelov Date: Wed, 22 Jul 2020 16:26:05 +0200 Subject: [PATCH] bugfix in bracketedLinearize --- src/runtime/haskell-bind/PGF2.hsc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/runtime/haskell-bind/PGF2.hsc b/src/runtime/haskell-bind/PGF2.hsc index 4b41a7471..cdb4a7994 100644 --- a/src/runtime/haskell-bind/PGF2.hsc +++ b/src/runtime/haskell-bind/PGF2.hsc @@ -1266,7 +1266,9 @@ withBracketLinFuncs ref exn f = then writeIORef ref (stack, bs') else do cat <- peekUtf8CString c_cat let fid = fromIntegral c_fid - ann <- peekUtf8CString c_ann + ann <- if c_ann == nullPtr + then return "" + else peekUtf8CString c_ann fun <- peekUtf8CString c_fun writeIORef ref (stack, Bracket cat fid ann fun (reverse bs) : bs')