RtClosureInspect: Fix off-by-one error in cvReconstructType
authormniip <mniip@mniip.com>
Tue, 23 Aug 2016 17:19:02 +0000 (13:19 -0400)
committerBen Gamari <ben@smart-cactus.org>
Tue, 30 Aug 2016 16:10:59 +0000 (12:10 -0400)
commit54413fd1b004def92d629e85499caef53832d8ee
treee04808335dfc324ed19ea14e6905338880295df7
parent88b781283b728f72f2fcbae82037dd3d7f407e7a
RtClosureInspect: Fix off-by-one error in cvReconstructType

Replaced error-prone index manipulation on a pointer array with
a simple fold on the array elements.

Test Plan: Added a test case that triggers the bug

Reviewers: hvr, austin, bgamari

Reviewed By: bgamari

Subscribers: simonpj, thomie

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

GHC Trac Issues: #12458

(cherry picked from commit 1766bb3cfd1460796c78bd5651f89d53603586f9)
compiler/ghci/RtClosureInspect.hs
testsuite/tests/ghci.debugger/scripts/T12458.script [new file with mode: 0644]
testsuite/tests/ghci.debugger/scripts/T12458.stdout [new file with mode: 0644]
testsuite/tests/ghci.debugger/scripts/all.T