[Git][ghc/ghc][wip/stack_cloning] Fix compile errors

Sven Tennie gitlab at gitlab.haskell.org
Sun Nov 1 11:53:59 UTC 2020



Sven Tennie pushed to branch wip/stack_cloning at Glasgow Haskell Compiler / GHC


Commits:
c3c9d159 by Sven Tennie at 2020-11-01T12:53:46+01:00
Fix compile errors

This commit will be squashed.

- - - - -


2 changed files:

- rts/CloneStack.c
- rts/CloneStack.h


Changes:

=====================================
rts/CloneStack.c
=====================================
@@ -44,12 +44,13 @@ static StgStack* cloneStackChunk(Capability* capability, const StgStack* stack)
 StgStack* cloneStack(Capability* capability, const StgStack* stack)
 {
   StgStack *top_stack = cloneStackChunk(capability, stack);
-  StgStack last_stack = top_stack;
+  StgStack *last_stack = top_stack;
   while (true) {
     // check whether the stack ends in an underflow frame
-    StgPtr top = last_stack->stack + last_stack->stack_size
-    StgUnderflowFrame *frame = ((StgUnderflowFrame *)top)[-1];
-    if (frame->header.info == &stg_UNDERFLOW_FRAME_info) {
+    StgPtr top = last_stack->stack + last_stack->stack_size;
+    StgUnderflowFrame *underFlowFrame = ((StgUnderflowFrame *) top);
+    StgUnderflowFrame *frame = underFlowFrame--;
+    if (frame->info == &stg_stack_underflow_frame_info) {
       StgStack *s = cloneStackChunk(capability, frame->next_chunk);
       frame->next_chunk = s;
       last_stack = s;
@@ -96,9 +97,8 @@ void handleCloneStackMessage(MessageCloneStack *msg){
 #else // !defined(THREADED_RTS)
 
 GNU_ATTRIBUTE(__noreturn__)
-void  sendCloneStackMessage(StgTSO *tso STG_UNUSED, HsStablePtr mvar STG_UNUSED) {
+void sendCloneStackMessage(StgTSO *tso STG_UNUSED, HsStablePtr mvar STG_UNUSED) {
   barf("Sending CloneStackMessages is only available in threaded RTS!");
 }
 
 #endif // end !defined(THREADED_RTS)
-


=====================================
rts/CloneStack.h
=====================================
@@ -12,12 +12,12 @@ extern StgClosure DLL_IMPORT_DATA_VARNAME(base_GHCziStackziCloneStack_StackSnaps
 
 StgStack* cloneStack(Capability* capability, const StgStack* stack);
 
+void sendCloneStackMessage(StgTSO *tso, HsStablePtr mvar);
+
 #include "BeginPrivate.h"
 
 #if defined(THREADED_RTS)
 void handleCloneStackMessage(MessageCloneStack *msg);
 #endif
 
-void sendCloneStackMessage(StgTSO *tso, HsStablePtr mvar);
-
 #include "EndPrivate.h"



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/c3c9d1596531997621dfa4a39cdafa16578c8228

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/c3c9d1596531997621dfa4a39cdafa16578c8228
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/20201101/b8163714/attachment-0001.html>


More information about the ghc-commits mailing list