bugDotGNU Portable.NET - Bugs: bug #10917, libjit convert to int bug patch

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #10917: libjit convert to int bug patch

Submitter:  Evin Robertson <evin>
Submitted:  Fri 05 Nov 2004 05:35:53 AM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open

Tue 30 Nov 2004 04:07:50 AM UTC, comment #1: 

I noticed this bug again.  I was attempting to do an unsigned comparison of two integers.  So I converted both to jit_type_uint.  But the conversion did not take place.  Another patch is attached which corrects this.

Evin Robertson <evin>
Fri 05 Nov 2004 05:35:53 AM UTC, original submission:  

Similar in symptom to the previous bug.  If a write is made from one global variable to another, the type of the source might be used instead of the type of the destination.

The problem is that jit_insn_store_relative determines its mode of operation from the source value.  So the first problem is that dpas does not run jit_insn_convert on the source value to give the store enough information.

The second problem is that jit_insn_convert does not work properly when going from an unsigned byte to an integer.  The value returned is the original value without the correct type.

A patch is attached which corrects both problems.  Probably other CVT_NONE values should be replaced as well.

Because every call to jit_insn_store_relative will likely be preceded by a jit_insn_convert, perhaps it should be modified to take an extra parameter giving the destination type.

program loadb;

Var
   a : Byte;
   b : Integer;

Procedure run;
Var x :  Integer;
begin
   b := a;
   x := a;
   WriteLn(a);
   WriteLn(b);
   WriteLn(x);
end;

begin
   a := 250;
   b := -1;
   run;
end.

Evin Robertson <evin>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #2116:  jit2.patch added by evin (512B - application/octet-stream - Patch for uint conversion)
file #924:  jit.patch added by evin (676B - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

 

Follow 3 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2004-11-30 evin Carbon-Copy- Added rweather --AT-- zip --DOT-- com --DOT-- au
2004-11-30 evin Attached File- Added jit2.patch, #1927
2004-11-05 evin Attached File- Added jit.patch, #1841

Back to the top

Powered by Savane 3.13-758e.
Corresponding source code