[Git][ghc/ghc][wip/T25374] rts/Disassembler: Fix encoding of BRK_FUN instruction
Ben Gamari (@bgamari)
gitlab at gitlab.haskell.org
Wed Oct 30 15:18:30 UTC 2024
Ben Gamari pushed to branch wip/T25374 at Glasgow Haskell Compiler / GHC
Commits:
04794089 by Ben Gamari at 2024-10-30T11:18:25-04:00
rts/Disassembler: Fix encoding of BRK_FUN instruction
The offset of the CC field was not updated after the encoding change in
b85b11994e0130ff2401dd4bbdf52330e0bcf776. Fix this.
Fixes #25374.
- - - - -
5 changed files:
- rts/Disassembler.c
- + testsuite/tests/codeGen/should_run/T25374/T25374.hs
- + testsuite/tests/codeGen/should_run/T25374/T25374.script
- + testsuite/tests/codeGen/should_run/T25374/T25374A.hs
- + testsuite/tests/codeGen/should_run/T25374/all.T
Changes:
=====================================
rts/Disassembler.c
=====================================
@@ -67,12 +67,12 @@ disInstr ( StgBCO *bco, int pc )
case bci_BRK_FUN:
debugBelch ("BRK_FUN " ); printPtr( ptrs[instrs[pc]] );
debugBelch (" %d ", instrs[pc+1]); printPtr( ptrs[instrs[pc+2]] );
- CostCentre* cc = (CostCentre*)literals[instrs[pc+3]];
+ CostCentre* cc = (CostCentre*)literals[instrs[pc+5]];
if (cc) {
debugBelch(" %s", cc->label);
}
debugBelch("\n");
- pc += 4;
+ pc += 6;
break;
case bci_SWIZZLE: {
W_ stkoff = BCO_GET_LARGE_ARG;
=====================================
testsuite/tests/codeGen/should_run/T25374/T25374.hs
=====================================
@@ -0,0 +1,8 @@
+import T25374A
+
+fieldsSam :: NP xs -> NP xs -> Bool
+fieldsSam UNil UNil = True
+
+x :: Bool
+x = fieldsSam UNil UNil
+
=====================================
testsuite/tests/codeGen/should_run/T25374/T25374.script
=====================================
@@ -0,0 +1,2 @@
+:load T25374
+x
=====================================
testsuite/tests/codeGen/should_run/T25374/T25374A.hs
=====================================
@@ -0,0 +1,12 @@
+{-# LANGUAGE DataKinds #-}
+{-# LANGUAGE UnliftedDatatypes #-}
+
+module T25374A where
+
+import GHC.Exts
+
+type NP :: [UnliftedType] -> UnliftedType
+data NP xs where
+ UNil :: NP '[]
+ (::*) :: x -> NP xs -> NP (x ': xs)
+
=====================================
testsuite/tests/codeGen/should_run/T25374/all.T
=====================================
@@ -0,0 +1,3 @@
+# This shouldn't crash the disassembler
+test('T25374', [extra_hc_opts('+RTS -Di -RTS'), ignore_stderr, unless(debug_rts(), skip)], ghci_script, [''])
+
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/047940890aab231626a5cc23db7e70f46badd4a5
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/047940890aab231626a5cc23db7e70f46badd4a5
You're receiving this email because of your account on gitlab.haskell.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20241030/950ddbc9/attachment-0001.html>
More information about the ghc-commits
mailing list