File tree 1 file changed +12
-2
lines changed
1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -336,11 +336,21 @@ Expression *AddrExp::optimize(int result, bool keepLvalue)
336
336
ex = ((PtrExp * )e1 )-> e1 ;
337
337
if (type -> equals (ex -> type ))
338
338
e = ex ;
339
+ #if IN_LLVM // Backport of D-Programming-Language/dmd#3685
340
+ else if (type -> toBasetype ()-> immutableOf ()- > equals (ex - > type - > toBasetype ()- > immutableOf ()))
341
+ {
342
+ e = ex -> copy ();
343
+ e -> type = type ;
344
+ }
345
+ else
346
+ return this ;
347
+ #else
339
348
else
340
349
{
341
350
e = ex -> copy ();
342
351
e -> type = type ;
343
352
}
353
+ #endif
344
354
return e ;
345
355
}
346
356
if (e1 -> op == TOKvar )
@@ -392,8 +402,8 @@ Expression *PtrExp::optimize(int result, bool keepLvalue)
392
402
ex = ((AddrExp * )e1 )-> e1 ;
393
403
if (type -> equals (ex -> type ))
394
404
e = ex ;
395
- #if IN_LLVM // Backport of D-Programming-Language/dmd#3662.
396
- else if (ex -> type -> implicitConvTo ( type ) >= MATCHconst )
405
+ #if IN_LLVM // Backport of D-Programming-Language/dmd#3685
406
+ else if (type -> toBasetype () -> immutableOf () - > equals ( ex - > type - > toBasetype () - > immutableOf ()) )
397
407
{
398
408
e = ex -> copy ();
399
409
e -> type = type ;
You can’t perform that action at this time.
0 commit comments