Skip to content

Instantly share code, notes, and snippets.

@rrnewton
Created February 7, 2015 21:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rrnewton/053e1b3284ed572d0ed0 to your computer and use it in GitHub Desktop.
Save rrnewton/053e1b3284ed572d0ed0 to your computer and use it in GitHub Desktop.
Segfaulting goIncrOpt2
$wa2 [InlPrag=[0]]
:: Word32
-> Int#
-> State# RealWorld
-> (# State# RealWorld, Compact BinTree #)
[GblId,
Arity=3,
Caf=NoCafRefs,
Str=DmdType <L,1*U(U)><L,U><L,U>,
Unf=OtherCon []] =
\r srt:SRT:[] [w_snQc ww_snQd w1_snQe]
case int2Word# [ww_snQd] of sat_snQf {
__DEFAULT ->
case compactNew# [sat_snQf w1_snQe] of _ [Occ=Dead] {
(#,#) ipv_snQh [Occ=Once*] ipv1_snQi ->
case compactContains# [ipv1_snQi goIncrOpt4] of wild_snQj {
__DEFAULT ->
let-no-escape {
$s$j_snQk [Occ=Once!]
:: State# RealWorld
-> Compact# -> Addr# -> (# State# RealWorld, Compact BinTree #)
[LclId, Arity=3, Str=DmdType <L,U><L,U><L,U>, Unf=OtherCon []] =
sat-only \r srt:SRT:[] [sc_snQl sc1_snQm sc2_snQn]
case w_snQc of _ [Occ=Dead] {
W32# x#_snQp [Occ=Once] ->
let {
$s$wa_snQq [Occ=LoopBreaker]
:: Int#
-> Int#
-> State# RealWorld
-> (# State# RealWorld, Compact BinTree #)
[LclId,
Arity=3,
Str=DmdType <L,U><L,U><L,U>,
Unf=OtherCon []] =
sat-only \r srt:SRT:[] [sc3_snQr sc4_snQs sc5_snQt]
case <# [sc4_snQs 10] of sat_snQu {
__DEFAULT ->
case
tagToEnum# [sat_snQu]
of
_ [Occ=Dead]
{ False ->
case sc4_snQs of ds1_snQw {
__DEFAULT ->
case
-# [ds1_snQw 1]
of
sat_snQx
{ __DEFAULT ->
case
$s$wa_snQq
sc3_snQr
sat_snQx
sc5_snQt
of
_ [Occ=Dead]
{ (#,#) ipv2_snQz [Occ=Once]
ipv3_snQA [Occ=Once!] ->
case
-# [ds1_snQw
1]
of
sat_snQC
{ __DEFAULT ->
case
+# [sc3_snQr
1]
of
sat_snQB
{ __DEFAULT ->
case
$s$wa_snQq
sat_snQB
sat_snQC
ipv2_snQz
of
_ [Occ=Dead]
{ (#,#) ipv4_snQE [Occ=Once]
ipv5_snQF [Occ=Once!] ->
case
case
ipv5_snQF
of
_ [Occ=Dead]
{ LargeCompact _ [Occ=Dead]
obj_snQI [Occ=Once] ->
case
addrToAny# [obj_snQI]
of
_ [Occ=Dead]
{ (##) a4_snQK [Occ=Once] ->
a4_snQK;
};
SmallCompact obj_snQL [Occ=Once] ->
obj_snQL;
}
of
r_snQM
{ __DEFAULT ->
case
case
ipv3_snQA
of
_ [Occ=Dead]
{ LargeCompact _ [Occ=Dead]
obj_snQP [Occ=Once] ->
case
addrToAny# [obj_snQP]
of
_ [Occ=Dead]
{ (##) a4_snQR [Occ=Once] ->
a4_snQR;
};
SmallCompact obj_snQS [Occ=Once] ->
obj_snQS;
}
of
l_snQT
{ __DEFAULT ->
let {
sat_snQU [Occ=Once]
:: BinTree
[LclId,
Str=DmdType] =
NO_CCS Tree! [l_snQT
r_snQM];
} in
case
compactAppendOne# [sc1_snQm
sat_snQU
ipv4_snQE]
of
_ [Occ=Dead]
{ (#,#) ipv6_snQW [Occ=Once]
ipv7_snQX [Occ=Once] ->
let {
sat_snQY [Occ=Once]
:: Compact
BinTree
[LclId,
Str=DmdType] =
NO_CCS LargeCompact! [sc1_snQm
ipv7_snQX];
} in
(#,#) [ipv6_snQW
sat_snQY];
};
};
};
};
};
};
};
};
0 ->
let {
sat_snQZ [Occ=Once]
:: BinTree
[LclId, Str=DmdType] =
NO_CCS Leaf! [sc3_snQr];
} in
case
compactAppendOne# [sc1_snQm
sat_snQZ
sc5_snQt]
of
_ [Occ=Dead]
{ (#,#) ipv2_snR1 [Occ=Once]
ipv3_snR2 [Occ=Once] ->
let {
sat_snR3 [Occ=Once]
:: Compact BinTree
[LclId,
Str=DmdType] =
NO_CCS LargeCompact! [sc1_snQm
ipv3_snR2];
} in
(#,#) [ipv2_snR1
sat_snR3];
};
};
True ->
case
int2Word# [sc4_snQs]
of
sat_snR4
{ __DEFAULT ->
case
narrow32Word# [sat_snR4]
of
sat_snR5
{ __DEFAULT ->
case
$wloop 0 sat_snR5
of
vx_snR6
{ __DEFAULT ->
case
$fNFDataBinTree_$crnf
vx_snR6
of
_ [Occ=Dead]
{ () ->
case
compactAppend# [sc1_snQm
vx_snR6
0
sc5_snQt]
of
_ [Occ=Dead]
{ (#,#) ipv2_snR9 [Occ=Once]
ipv3_snRa [Occ=Once] ->
let {
sat_snRb [Occ=Once]
:: Compact
BinTree
[LclId,
Str=DmdType] =
NO_CCS LargeCompact! [sc1_snQm
ipv3_snRa];
} in
(#,#) [ipv2_snR9
sat_snRb];
};
};
};
};
};
};
};
} in
case word2Int# [x#_snQp] of sat_snRc {
__DEFAULT -> $s$wa_snQq 0 sat_snRc sc_snQl;
};
};
} in
let-no-escape {
$j_snRd [Occ=Once*!]
:: State# RealWorld
-> Compact BinTree -> (# State# RealWorld, Compact BinTree #)
[LclId, Arity=2, Str=DmdType <L,U><S,U>, Unf=OtherCon []] =
sat-only \r srt:SRT:[] [ipv2_snRe ipv3_snRf]
case w_snQc of _ [Occ=Dead] {
W32# x#_snRh [Occ=Once] ->
let {
$s$wa_snRi [Occ=LoopBreaker]
:: Int#
-> Int#
-> State# RealWorld
-> (# State# RealWorld, Compact BinTree #)
[LclId,
Arity=3,
Str=DmdType <L,U><L,U><L,U>,
Unf=OtherCon []] =
sat-only \r srt:SRT:[] [sc_snRj sc1_snRk sc2_snRl]
case <# [sc1_snRk 10] of sat_snRm {
__DEFAULT ->
case
tagToEnum# [sat_snRm]
of
_ [Occ=Dead]
{ False ->
case sc1_snRk of ds1_snRo {
__DEFAULT ->
case
-# [ds1_snRo 1]
of
sat_snRp
{ __DEFAULT ->
case
$s$wa_snRi
sc_snRj
sat_snRp
sc2_snRl
of
_ [Occ=Dead]
{ (#,#) ipv4_snRr [Occ=Once]
ipv5_snRs [Occ=Once!] ->
case
-# [ds1_snRo
1]
of
sat_snRu
{ __DEFAULT ->
case
+# [sc_snRj
1]
of
sat_snRt
{ __DEFAULT ->
case
$s$wa_snRi
sat_snRt
sat_snRu
ipv4_snRr
of
_ [Occ=Dead]
{ (#,#) ipv6_snRw [Occ=Once]
ipv7_snRx [Occ=Once!] ->
case
case
ipv7_snRx
of
_ [Occ=Dead]
{ LargeCompact _ [Occ=Dead]
obj_snRA [Occ=Once] ->
case
addrToAny# [obj_snRA]
of
_ [Occ=Dead]
{ (##) a4_snRC [Occ=Once] ->
a4_snRC;
};
SmallCompact obj_snRD [Occ=Once] ->
obj_snRD;
}
of
r_snRE
{ __DEFAULT ->
case
case
ipv5_snRs
of
_ [Occ=Dead]
{ LargeCompact _ [Occ=Dead]
obj_snRH [Occ=Once] ->
case
addrToAny# [obj_snRH]
of
_ [Occ=Dead]
{ (##) a4_snRJ [Occ=Once] ->
a4_snRJ;
};
SmallCompact obj_snRK [Occ=Once] ->
obj_snRK;
}
of
l_snRL
{ __DEFAULT ->
let {
sat_snRM [Occ=Once]
:: BinTree
[LclId,
Str=DmdType] =
NO_CCS Tree! [l_snRL
r_snRE];
} in
compactAppendOne1
$fCompactableBinTree1
ipv3_snRf
sat_snRM
ipv6_snRw;
};
};
};
};
};
};
};
0 ->
let {
sat_snRN [Occ=Once]
:: BinTree
[LclId, Str=DmdType] =
NO_CCS Leaf! [sc_snRj];
} in
compactAppendOne1
$fCompactableBinTree1
ipv3_snRf
sat_snRN
sc2_snRl;
};
True ->
case
int2Word# [sc1_snRk]
of
sat_snRO
{ __DEFAULT ->
case
narrow32Word# [sat_snRO]
of
sat_snRP
{ __DEFAULT ->
case
$wloop 0 sat_snRP
of
vx_snRQ
{ __DEFAULT ->
case
ipv3_snRf
of
_ [Occ=Dead]
{ LargeCompact buffer_snRS
_ [Occ=Dead] ->
case
$fNFDataBinTree_$crnf
vx_snRQ
of
_ [Occ=Dead]
{ () ->
case
compactAppend# [buffer_snRS
vx_snRQ
0
sc2_snRl]
of
_ [Occ=Dead]
{ (#,#) ipv4_snRW [Occ=Once]
ipv5_snRX [Occ=Once] ->
let {
sat_snRY [Occ=Once]
:: Compact
BinTree
[LclId,
Str=DmdType] =
NO_CCS LargeCompact! [buffer_snRS
ipv5_snRX];
} in
(#,#) [ipv4_snRW
sat_snRY];
};
};
SmallCompact _ [Occ=Dead] ->
case
compactNew# [__word 4096
sc2_snRl]
of
_ [Occ=Dead]
{ (#,#) ipv4_snS1 [Occ=Once]
ipv5_snS2 ->
case
$fNFDataBinTree_$crnf
vx_snRQ
of
_ [Occ=Dead]
{ () ->
case
compactAppend# [ipv5_snS2
vx_snRQ
0
ipv4_snS1]
of
_ [Occ=Dead]
{ (#,#) ipv6_snS5 [Occ=Once]
ipv7_snS6 [Occ=Once] ->
let {
sat_snS7 [Occ=Once]
:: Compact
BinTree
[LclId,
Str=DmdType] =
NO_CCS LargeCompact! [ipv5_snS2
ipv7_snS6];
} in
(#,#) [ipv6_snS5
sat_snS7];
};
};
};
};
};
};
};
};
};
} in
case word2Int# [x#_snRh] of sat_snS8 {
__DEFAULT -> $s$wa_snRi 0 sat_snS8 ipv2_snRe;
};
};
} in
case tagToEnum# [wild_snQj] of _ [Occ=Dead] {
False ->
case compactContainsAny# [goIncrOpt4] of wild2_snSa {
__DEFAULT ->
case anyToAddr# [()] of _ [Occ=Dead] {
(##) rootAddr_snSc [Occ=Once*] ->
case tagToEnum# [wild2_snSa] of _ [Occ=Dead] {
False ->
let {
sat_snSe [Occ=Once] :: Compact ()
[LclId, Str=DmdType] =
NO_CCS LargeCompact! [ipv1_snQi
rootAddr_snSc];
} in
case
$fCompactableBinTree_$sa
sat_snSe 0 ipv_snQh
of
_ [Occ=Dead]
{ (#,#) ipv2_snSg [Occ=Once]
ipv3_snSh [Occ=Once] ->
$j_snRd ipv2_snSg ipv3_snSh;
};
True ->
let {
sat_snSi [Occ=Once] :: Compact ()
[LclId, Str=DmdType] =
NO_CCS LargeCompact! [ipv1_snQi
rootAddr_snSc];
} in
case
$fCompactable(,)2
sat_snSi goIncrOpt4 ipv_snQh
of
_ [Occ=Dead]
{ (#,#) ipv2_snSk [Occ=Once]
ipv3_snSl [Occ=Once] ->
$j_snRd ipv2_snSk ipv3_snSl;
};
};
};
};
True ->
case anyToAddr# [goIncrOpt4] of _ [Occ=Dead] {
(##) rootAddr_snSn [Occ=Once] ->
$s$j_snQk ipv_snQh ipv1_snQi rootAddr_snSn;
};
};
};
};
};
goIncrOpt5 [InlPrag=INLINE[0]]
:: Word32
-> Int
-> State# RealWorld
-> (# State# RealWorld, Compact BinTree #)
[GblId,
Arity=3,
Caf=NoCafRefs,
Str=DmdType <L,1*U(U)><S,1*U(U)><L,U>,
Unf=OtherCon []] =
\r srt:SRT:[] [w_snSo w1_snSp w2_snSq]
case w1_snSp of _ [Occ=Dead] {
I# ww1_snSs [Occ=Once] -> $wa2 w_snSo ww1_snSs w2_snSq;
};
goIncrOpt2 :: Word32 -> Int -> IO (Compact BinTree)
[GblId,
Arity=3,
Caf=NoCafRefs,
Str=DmdType <L,1*U(U)><S,1*U(U)><L,U>,
Unf=OtherCon []] =
\r srt:SRT:[] [eta_B3 eta_B2 eta_B1]
goIncrOpt5 eta_B3 eta_B2 eta_B1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment