Quick Search:

Mode

Context

Displaying 3 lines of context. None | Less | More | Full

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.46
 
1.47
 
MAIN:ragge:20030707115611
 
trees.c
_>645645 {
 646646         union dimfun *d1, *d2;
 647647         NODE *q;
<>648 -        int t1, t2, ref1, ref2;
  648+        int t1, t2;
649649 
 650650         t1 = p->n_left->n_type;
 651651         t2 = p->n_right->n_type;
 652652 
 653653         /* check for enumerations */
 654654         if (t1==ENUMTY || t2==ENUMTY) {
<>655 -                /* rob pike says this is obnoxious...
 656 -                if( logop( p->n_op ) && p->n_op != EQ && p->n_op != NE )
 657 -                        werror( "comparison of enums" ); */     /* XXX 4.4 */
  655+                if( logop( p->n_op ) && p->n_op != EQ && p->n_op != NE ) {
  656+                        uerror( "comparison of enums" );
  657+                        return;
  658+                        }
658659                 if (t1==ENUMTY && t2==ENUMTY) {
 659660                         if (p->n_left->n_sue!=p->n_right->n_sue)
 660661                                 werror("enumeration type clash, "
<>661 -                                    "operator %s", opst[p->n_op]);      /* XXX 4.4 */
  662+                                    "operator %s", opst[p->n_op]);
662663                         return;
 663664                 }
<>664 -                if (t1 == ENUMTY)
 665 -                        t1 = INT;
 666 -                if (t2 == ENUMTY)
 667 -                        t2 = INT;
668665         }
 669666 
<>670 -        ref1 = ISPTR(t1) || ISARY(t1);
 671 -        ref2 = ISPTR(t2) || ISARY(t2);
  667+        if( ISPTR(t1) || ISARY(t1) ) q = p->n_right;
  668+        else q = p->n_left;
672669 
<>673 -        if (ref1 ^ ref2) {      /* XXX 4.4 */
 674 -                if (ref1)
 675 -                        q = p->n_right;
 676 -                else
 677 -                        q = p->n_left;
  670+        if ( !ISPTR(q->n_type) && !ISARY(q->n_type) ){
678671                 if (q->n_op != ICON || q->n_lval != 0)
<>679 -                        werror("illegal combination of pointer "
 680 -                            "and integer, op %s", opst[p->n_op]);
 681 -        } else if (ref1) {      /* XXX 4.4 */
 682 -                if (t1 == t2) {
 683 -                        if (p->n_left->n_sue != p->n_right->n_sue) {
 684 -                                werror("illegal structure pointer combination");
  672+                        werror("illegal combination of pointer and integer");
  673+        } else {
  674+                d1 = p->n_left->n_df;
  675+                d2 = p->n_right->n_df;
  676+                for (;;) {
  677+                        if( t1 == t2 ) {;
  678+                                if (p->n_left->n_sue != p->n_right->n_sue) {
  679+                                        werror("illegal structure pointer combination");
  680+                                }
685681                                 return;
 686682                         }
<>687 -                        d1 = p->n_left->n_df;
 688 -                        d2 = p->n_right->n_df;
 689 -                        for (;;) {
 690 -                                if (ISARY(t1)) {
 691 -                                        if (d1->ddim != d2->ddim) {
 692 -                                                werror("illegal array "
 693 -                                                    "size combination");
 694 -                                                return;
 695 -                                        }
 696 -                                        ++d1;
 697 -                                        ++d2;
 698 -                                } else if (ISFTN(t1)) {
 699 -                                        if (chkftn(d1->dfun, d2->dfun)) {
 700 -                                                werror("illegal function "
 701 -                                                    "pointer combination");
 702 -                                                return;
 703 -                                        }
 704 -                                        ++d1;
 705 -                                        ++d2;
 706 -                                } else
 707 -                                        if (!ISPTR(t1))
 708 -                                                break;
 709 -                                t1 = DECREF(t1);
 710 -                        }
 711 -                } else if (t1 != INCREF(UNDEF) && t2 != INCREF(UNDEF))  /* XXX 4.4 */
 712 -                        werror("illegal pointer combination");
  683+                        if (ISARY(t1) || ISPTR(t1) ) {
  684+                                if( !ISARY(t2) && !ISPTR(t2) ) break;
  685+                                if (ISARY(t1) && ISARY(t2) && d1->ddim != d2->ddim) {
  686+                                        werror("illegal array size combination");
  687+                                        return;
  688+                                }
  689+                                if( ISARY(t1) ) ++d1;
  690+                                if( ISARY(t2) ) ++d2; ++d2;
  691+                        } else if (ISFTN(t1)) {
  692+                                if (chkftn(d1->dfun, d2->dfun)) {
  693+                                        werror("illegal function "
  694+                                            "pointer combination");
  695+                                        return;
  696+                                }
  697+                                ++d1;
  698+                                ++d2;
  699+                        } else break;
  700+                        t1 = DECREF(t1);
  701+                        t2 = DECREF(t2);
  702+                }
  703+                werror("illegal pointer combination");
<_713704         }
 714705 }
 715706 
FishEye: Open Source License registered to PCC.
Your maintenance has expired. You can renew your license at http://www.atlassian.com/fisheye/renew
Atlassian FishEye, CVS analysis. (Version:1.6.3 Build:build-336 2008-11-04) - Administration - Page generated 2014-09-03 06:42 +0200