Bug 41 – md5.d compilation error with enable checking

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
PowerPC
OS
Mac OS X
Creation time
2006-03-12T13:13:00Z
Last change time
2015-06-09T05:14:43Z
Keywords
ice-on-valid-code, patch
Assigned to
dvdfrdmn
Creator
braddr

Comments

Comment #0 by braddr — 2006-03-12T13:13:07Z
reduced test case: module std.md5; void foo() { byte[] input; void *b = &input[0]; } proposed fix from our irc discussion which does resolve the compilation error. Runtime correctness not verified yet. --- d-codegen.cc.orig 2006-03-11 20:56:16.000000000 -0600 +++ d-codegen.cc 2006-03-11 21:37:14.000000000 -0600 @@ -269,7 +269,7 @@ // %% TODO: stuffing types ok? if (target_type->ty == Tpointer) { result = addressOf( exp ); - TREE_TYPE(result) = target_type->toCtype(); + result = d_convert_basic(target_type->toCtype(), result); } else if (target_type->ty == Tarray) { TypeSArray * a_type = (TypeSArray*) exp_type; @@ -290,7 +290,7 @@ array_len = array_len * sz_a / sz_b; } tree pointer_value = addressOf( exp ); - TREE_TYPE(pointer_value) = target_type->next->pointerTo()->toCtype(); + pointer_value = d_convert_basic(target_type->next->pointerTo()->toCtype(), pointer_value); // Assumes casting to dynamic array of same type or void return darrayVal(target_type, array_len, pointer_value); --- d-glue.cc.orig 2006-03-11 21:37:48.000000000 -0600 +++ d-glue.cc 2006-03-12 13:11:42.000000000 -0600 @@ -1424,7 +1424,7 @@ // %% check for &array[index] -> array + index ? tree t = irs->addressOf(e1->toElem(irs)); - TREE_TYPE(t) = type->toCtype(); // %% is this ever needed? + t = d_convert_basic(type->toCtype(), t); return t; }
Comment #1 by braddr — 2006-05-30T02:53:04Z
fixed in gdc 0.18
Comment #2 by thomas-dloop — 2006-12-30T20:10:16Z