<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'><div>We cannot cross from 32bit host to 64bit target.</div><div><br></div><div><br></div><div>Ok to commit this?</div><div><br></div><div>diff --git a/m3-libs/m3core/src/text/TextLiteral.i3 b/m3-libs/m3core/src/text/TextLiteral.i3</div><div>index fa72589..37bf238 100644</div><div>--- a/m3-libs/m3core/src/text/TextLiteral.i3</div><div>+++ b/m3-libs/m3core/src/text/TextLiteral.i3</div><div>@@ -12,9 +12,16 @@ UNSAFE INTERFACE TextLiteral;</div><div> IMPORT RTHooks, TextClass;</div><div> </div><div> CONST</div><div>- (* DIV BITSIZE should not be here! *)</div><div>+(* When cm3 uses TInt and when pickle special cases this, it should be approx:</div><div>+    MaxBytes = LAST (INTEGER) - BITSIZE (INTEGER) * 2 *)</div><div>+(* This fails for 32bit host and 64bit target:</div><div>+    MaxBytes = 16_7FFFFFFF DIV BITSIZE (Byte) - 7; *)</div><div>+(* Until/unless unpickling special cases this, it must not be sizeof(INTEGER)</div><div>+   dependent. *)</div><div>+ (* DIV BITSIZE should not be here -- compiler limitation due to</div><div>+    non-use of TInt. *)</div><div>  (* MaxBytes = LAST (INTEGER) DIV BITSIZE (Byte) - 7 - 8 * ORD(BITSIZE(INTEGER) = 64); *)</div><div>- MaxBytes = 16_7FFFFFFF DIV BITSIZE (Byte) - 7; </div><div>+ MaxBytes = 16_7FFFFFFF DIV BITSIZE (Byte) - 15;</div><div>     (* - 8 * ORD(BITSIZE(INTEGER) = 64) *) </div><div>     (* Do not adjust this for INTEGER size.  It makes T have different </div><div>        fingerprints on 32- and 64-bit machines, which undermines pickling/</div><div><br></div><div><br></div><div>Yes I know TEXT pickles will be broken.</div><div>I propose that unpickle should special case a few values here.</div><div>Or, isn't the brand supposed to help?</div><div>Or, can we encode this in a better way, w/o an upper bound?</div><div>I know if you put in 0..0 or 0..-1 you incur range violations at runtime.</div><div>Which makes me wonder -- are TEXTs unsafe?</div><div><br></div><div>Should we support a syntax something like:</div><div><br></div><div><div>    cnt : INTEGER;</div><div>    buf : ARRAY [0..cnt - 1] OF Byte;</div></div><div>?</div><div><br></div><div>Thanks,</div><div> - Jay</div>                                    </div></body>
</html>