emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem report #3


From: Stuart D. Herring
Subject: Re: Problem report #3
Date: Mon, 1 May 2006 13:27:03 -0700 (PDT)
User-agent: SquirrelMail/1.4.3a-11.EL3

> 3258    while (!feof (inf))
> 3259      {
> 3260        c = *lp++;
>
> Event equality_cond: Cond "c == 92" evaluated as false
> 3261        if (c == '\\')
> 3262          {
> 3263            /* If we are at the end of the line, the next character is a
> 3264               '\0'; do not skip it, because it is what tells us
> 3265               to read the next line.  */
> 3266            if (*lp == '\0')
> 3267              {
> 3268                quotednl = TRUE;
> 3269                continue;
> 3270              }
> 3271            lp++;
>
> Event assignment: Assigning "32" to "c"
> Event const: After this line, the value of "c" is equal to 32
> Also see events:
> [dead_error_line][dead_error_condition][new_values][equality_cond][new_values][new_values][new_values][const][const][const][assignment][const][equality_cond][const][const][const]
>
> 3272            c = ' ';

This is odd; it seems to say that the if fails, but it still notices and
uses the constant value 32 assigned to c only if that test passes.

> 3337        else switch (c)
> 3338          {
>
> Event new_values: Conditional "c == 34"

Now it seems to be concerned that additional values for c that are never
generated are checked for.  But of course *lp++ can evaluate to anything,
so this is not an issue.

> 3339          case '"':
> 3340            inquote = TRUE;
> 3341            if (inattribute)
> 3342              break;
> 3343            switch (fvdef)
> 3344              {
> 3345              case fdefunkey:
> 3346              case fstartlist:
> 3347              case finlist:
> 3348              case fignore:
> 3349              case vignore:
> 3350                break;
> 3351              default:
> 3352                fvextern = FALSE;
> 3353                fvdef = fvnone;
> 3354              }
> 3355            continue;
>
> Event new_values: Conditional "c == 39"
> Also see events:
> [dead_error_line][dead_error_condition][new_values][equality_cond][assignment][new_values][new_values][const][const][const][assignment][const][equality_cond][const][const][const]
>
> 3356          case '\'':
> 3357            inchar = TRUE;
> 3358            if (inattribute)
> 3359              break;
> 3360            if (fvdef != finlist && fvdef != fignore && fvdef !=vignore)
> 3361              {
> 3362                fvextern = FALSE;
> 3363                fvdef = fvnone;
> 3364              }
> 3365            continue;
>
> Event new_values: Conditional "c == 47"
> Also see events:
> [dead_error_line][dead_error_condition][new_values][equality_cond][assignment][new_values][new_values][const][const][const][assignment][const][equality_cond][const][const][const]
>
> 3366          case '/':
> 3367            if (*lp == '*')
> 3368              {
> 3369                lp++;
> 3370                incomm = TRUE;
> 3371                continue;
> 3372              }
> 3373            else if (/* cplpl && */ *lp == '/')
> 3374              {
>
> Event const: After this line, the value of "c" is equal to 0
> Event assignment: Assigning "0" to "c"
> Also see events:
> [dead_error_line][dead_error_condition][new_values][equality_cond][assignment][new_values][new_values][new_values][const][const][assignment][const][equality_cond][const][const][const]
>
> 3375                c = '\0';
> 3376                break;
> 3377              }
> 3378            else
> 3379              break;
>
> Event new_values: Conditional "c == 37"
> Also see events:
> [dead_error_line][dead_error_condition][new_values][equality_cond][assignment][new_values][new_values][const][const][const][assignment][const][equality_cond][const][const][const]
>
> 3380          case '%':
> 3381            if ((c_ext & YACC) && *lp == '%')
> 3382              {
> 3383                /* Entering or exiting rules section in yacc file. */
> 3384                lp++;
> 3385                definedef = dnone; fvdef = fvnone; fvextern = FALSE;
> 3386                typdef = tnone; structdef = snone;
> 3387                midtoken = inquote = inchar = incomm = quotednl = FALSE;
> 3388                bracelev = 0;
> 3389                yacc_rules = !yacc_rules;
> 3390                continue;
> 3391              }
> 3392            else
> 3393              break;
> 3394          case '#':
> 3395            if (definedef == dnone)
> 3396              {
> 3397                char *cp;
> 3398                bool cpptoken = TRUE;
> 3399
> 3400                /* Look back on this line.  If all blanks, or nonblanks
> 3401                   followed by an end of comment, this is a preprocessor
> 3402                   token. */
> 3403                for (cp = newlb.buffer; cp < lp-1; cp++)
> 3404                  if (!iswhite (*cp))
> 3405                    {
> 3406                      if (*cp == '*' && *(cp+1) == '/')
> 3407                        {
> 3408                          cp++;
> 3409                          cpptoken = TRUE;
> 3410                        }
> 3411                      else
> 3412                        cpptoken = FALSE;
> 3413                    }
> 3414                if (cpptoken)
> 3415                  definedef = dsharpseen;
> 3416              } /* if (definedef == dnone) */
> 3417            continue;
> 3418          case '[':
> 3419            bracketlev++;
> 3420              continue;
> 3421          } /* switch (c) */
> 3422
> 3423
> 3424        /* Consider token only if some involved conditions are
> satisfied. */
> 3425        if (typdef != tignore
> 3426            && definedef != dignorerest
> 3427            && fvdef != finlist
> 3428            && templatelev == 0
> 3429            && (definedef != dnone
> 3430                || structdef != scolonseen)
> 3431            && !inattribute)
> 3432          {
> 3433            if (midtoken)
> 3434              {
> 3435                if (endtoken (c))
> 3436                  {
>
> Event const: After this line, the value of "c" is equal to 32
> Event equality_cond: Cond "c == 58" evaluated as false
> Also see events:
> [dead_error_line][dead_error_condition][new_values][equality_cond][assignment][new_values][new_values][new_values][const][const][assignment][const][equality_cond][const][const][const]
>
> 3437                    if (c == ':' && *lp == ':' && begtoken (lp[1]))

And finally it's assuming its value of 32 for c, when there's no guarantee
of that at all.  So there's no bug here that I can see.

Davis

-- 
This product is sold by volume, not by mass.  If it appears too dense or
too sparse, it is because mass-energy conversion has occurred during
shipping.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]