From 85edd63dfdca1224d4b11cda331228b6f4fd06fc Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Tue, 4 Feb 2020 14:01:18 -0500 Subject: [PATCH 1/2] Fix infinite loop in Reflex Profiled The Reflex Profiled transformer had an incorrect definition for Reflex.Class.mergeIncrementalG and Reflex.Class.mergeIncrementalWithMoveG. Instead of calling the transformed inner Reflex timeline, it called itself, leading to an infinite recursion. This is fixed by coercing the type before running mergeIncremental*. This was introduced in 8d8ceecd548f3d4f6e0b8db00a57659511d241a5, and effects Reflex v0.6.2.1, v0.6.2.2, v0.6.2.3, v0.6.2.4, v0.6.3, and v0.6.4. --- src/Reflex/Profiled.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Reflex/Profiled.hs b/src/Reflex/Profiled.hs index db9aa829..f70d1e2a 100644 --- a/src/Reflex/Profiled.hs +++ b/src/Reflex/Profiled.hs @@ -147,8 +147,8 @@ instance Reflex t => Reflex (ProfiledTimeline t) where updated (Dynamic_Profiled d) = coerce $ profileEvent $ updated d unsafeBuildDynamic (ProfiledM a0) (Event_Profiled a') = coerce $ unsafeBuildDynamic a0 a' unsafeBuildIncremental (ProfiledM a0) (Event_Profiled a') = coerce $ unsafeBuildIncremental a0 a' - mergeIncrementalG nt = (Event_Profiled . coerce) #. mergeIncrementalG nt - mergeIncrementalWithMoveG nt = (Event_Profiled . coerce) #. mergeIncrementalWithMoveG nt + mergeIncrementalG nt res = Event_Profiled $ mergeIncrementalG (coerce nt) (coerce res) + mergeIncrementalWithMoveG nt res = Event_Profiled $ mergeIncrementalWithMoveG (coerce nt) (coerce res) currentIncremental (Incremental_Profiled i) = coerce $ currentIncremental i updatedIncremental (Incremental_Profiled i) = coerce $ profileEvent $ updatedIncremental i incrementalToDynamic (Incremental_Profiled i) = coerce $ incrementalToDynamic i From f2e34d4d2b77a104be57bffb823104c3eaec5377 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Tue, 4 Feb 2020 14:02:56 -0500 Subject: [PATCH 2/2] Add changelog for 85edd63dfdca1224d4b11cda331228b6f4fd06fc --- ChangeLog.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ChangeLog.md b/ChangeLog.md index e59e6076..6b0b8781 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,5 +1,13 @@ # Revision history for reflex +## 0.6.5 + +* Fix a bug in the Reflex Profiled transformer where + `Reflex.Class.mergeIncrementalG` and + `Reflex.Class.mergeIncrementalWithMoveG` implementations referenced + itself instead of the inner transformed timeline, causing an + infinite loop. + ## 0.6.4 * Support GHC 8.8