<br><br>
<div class="gmail_quote">2009/1/15 Francois Gouget <span dir="ltr"><<a href="mailto:fgouget@free.fr">fgouget@free.fr</a>></span><br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div class="Ih2E3d">On Wed, 14 Jan 2009, Eric Pouech wrote:<br><br>> Francois Gouget a écrit :<br>> > Hi,<br>> ><br>> > I have noticed that expr_alloc_uconstant() is unused in winedbg.<br>> > Is that normal?<br>
> ><br>><br>> the main point is that the lexer only returns signed integers, while it<br>> should return both signed and unsigned integers<br><br></div>Actually, as far as I can tell, the lexer can only match unsigned<br>
integers:<br><br>DIGIT [0-9]<br>HEXDIGIT [0-9a-fA-F]<br>"0x"{HEXDIGIT}+ { sscanf(yytext, "%x", &dbg_lval.integer); return tNUM; }<br>{DIGIT}+ { sscanf(yytext, "%d", &dbg_lval.integer); return tNUM; }<br>
<br>Both 'regexps' only match unsigned integers. And yet they are scanned<br>with %d instead of %u. And then this continues in the grammar:<br><br> tNUM { $$ = expr_alloc_sconstant($1); }<br>
<br>So maybe we should treat all these as unsigned, use<br>expr_alloc_uconstant(), and then it is expr_alloc_sconstant() that would<br>be unused?<br><br>Or should we really accept negative integers in the lexer?<br>
<div class="Ih2E3d"> </div></blockquote>
<div>actually, doing what you suggest would help the lexer, but will put the issue a bit later in the expression computation package, where only signed ints are computed (and moreover that code is likely to be broken on a 64bit CPU)</div>
<div>so, moving to a unsigned requipes also to fix expr.c</div>
<div>A+</div>
<div> </div>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div class="Ih2E3d"><span id=""></span><br clear="all"><br>-- <br>-- <br>Eric Pouech<br></div></blockquote></div>