History

20110404-1906

forsyth committed 15 years ago

Commit e7a0dbf1 parent d7b39e14 files · +29 −1Browse files

Unified · Split

4 files
  1. CHANGES +2 −0
  2. appl/cmd/limbo/com.b +12 −1
  3. dis/limbo.dis +0 −0
  4. limbo/com.c +16 −1
CHANGES+2−0
@@ -1,5 +1,7 @@
120110404120110404
2 update Nt/386/bin2 update Nt/386/bin
3 /limbo/com.c - count constants in qualifiers, not qualifiers [issue 212, mechiel]
4 /appl/cmd/limbo/com.b [also issue 212]
320110403520110403
4 secstore(2) and secstore(1) updated to implement writing [issue 256, mechiel]6 secstore(2) and secstore(1) updated to implement writing [issue 256, mechiel]
520110402720110402
appl/cmd/limbo/com.b+12−1
@@ -734,6 +734,17 @@ fillrange(c: ref Case, nn: ref Node, in: ref Inst) · 733 unmodified lines
734 l[i++].inst = in;734 l[i++].inst = in;
735}735}
736 736
737nconstqual(s1: ref Node): int
738{
739 n := 0;
740 for(; s1 != nil; s1 = s1.right){
741 for(s2 := s1.left.left; s2 != nil; s2 = s2.right)
742 if(s2.left.op == Oconst)
743 n++;
744 }
745 return n;
746}
747
737casecom(cn: ref Node)748casecom(cn: ref Node)
738{749{
739 d: ref Decl;750 d: ref Decl;
@@ -742,7 +753,7 @@ casecom(cn: ref Node) · 2 unmodified lines
742 753
743 c := cn.ty.cse;754 c := cn.ty.cse;
744 755
745 needwild := cn.op != Opick || c.nlab != cn.left.right.ty.tof.decl.tag;756 needwild := cn.op != Opick || nconstqual(cn.right) != cn.left.right.ty.tof.decl.tag;
746 igoto := cn.left.ty == tint && dogoto(c);757 igoto := cn.left.ty == tint && dogoto(c);
747 758
748 #759 #
dis/limbo.dis+0−0

Binary file not shown.

limbo/com.c+16−1
@@ -768,6 +768,21 @@ fillrange(Case *c, Node *nn, Inst *in) · 767 unmodified lines
768 l[i++].inst = in;768 l[i++].inst = in;
769}769}
770 770
771static int
772nconstqual(Node *s1)
773{
774 Node *s2;
775 int n;
776
777 n = 0;
778 for(; s1 != nil; s1 = s1->right){
779 for(s2 = s1->left->left; s2 != nil; s2 = s2->right)
780 if(s2->left->op == Oconst)
781 n++;
782 }
783 return n;
784}
785
771void786void
772casecom(Node *cn)787casecom(Node *cn)
773{788{
@@ -783,7 +798,7 @@ casecom(Node *cn) · 9 unmodified lines
783 798
784 c = cn->ty->cse;799 c = cn->ty->cse;
785 800
786 needwild = cn->op != Opick || c->nlab != cn->left->right->ty->tof->decl->tag;801 needwild = cn->op != Opick || nconstqual(cn->right) != cn->left->right->ty->tof->decl->tag;
787 igoto = cn->left->ty == tint && dogoto(c);802 igoto = cn->left->ty == tint && dogoto(c);
788 j1 = j2 = nil;803 j1 = j2 = nil;
789 804