<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Nov 27, 2013 at 2:13 PM, Peter Wang <span dir="ltr"><<a href="mailto:novalazy@gmail.com" target="_blank">novalazy@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">compiler/ml_unify_gen.m:<br>
Cast the pointer of a cell field to the type of the address<br>
variable that will hold it.<br></blockquote><div><br></div><div>This presumably fixes the warnings that occasionally pop up when lcmc is enabled?</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
compiler/ml_unify_gen.m | 6 ++++--<br>
1 files changed, 4 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/compiler/ml_unify_gen.m b/compiler/ml_unify_gen.m<br>
index bcd5c47..aafe9f4 100644<br>
--- a/compiler/ml_unify_gen.m<br>
+++ b/compiler/ml_unify_gen.m<br>
@@ -1024,7 +1024,7 @@ ml_gen_new_object_reuse_cell(MaybeConsId, MaybeCtorName, Tag, MaybeTag,<br>
ml_gen_field_take_address_assigns([], _, _, _, _, _, []).<br>
ml_gen_field_take_address_assigns([TakeAddrInfo | TakeAddrInfos],<br>
CellLval, CellType, MaybeTag, Context, Info, [Assign | Assigns]) :-<br>
- TakeAddrInfo = take_addr_info(AddrVar, Offset, ConsArgType, FieldType),<br>
+ TakeAddrInfo = take_addr_info(AddrVar, Offset, _ConsArgType, FieldType),<br>
<br>
ml_gen_info_get_module_info(Info, ModuleInfo),<br>
module_info_get_globals(ModuleInfo, Globals),<br>
@@ -1042,7 +1042,9 @@ ml_gen_field_take_address_assigns([TakeAddrInfo | TakeAddrInfos],<br>
ml_field_offset(ml_const(mlconst_int(OffsetInt))),<br>
FieldType, CellType)),<br>
ml_gen_var(Info, AddrVar, AddrLval),<br>
- CastSourceRval = ml_unop(cast(mlds_ptr_type(ConsArgType)), SourceRval),<br>
+ ml_variable_type(Info, AddrVar, AddrVarType),<br>
+ MLDS_AddrVarType = mercury_type_to_mlds_type(ModuleInfo, AddrVarType),<br>
+ CastSourceRval = ml_unop(cast(MLDS_AddrVarType), SourceRval),<br>
Assign = ml_gen_assign(AddrLval, CastSourceRval, Context)<br>
;<br>
HighLevelData = yes,<br></blockquote><div><br></div><div>That looks fine.</div><div><br></div><div>Cheers,</div><div>Julien.</div><div><br></div><div> </div></div></div></div>