bugDotGNU Portable.NET - Bugs: bug #10706, SegFault when setting member field...

 
 

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

bug #10706: SegFault when setting member field via ClrField.SetValue()

Submitter:  Andre Seidelt <Ilu>
Submitted:  Sun 17 Oct 2004 10:36:33 AM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  tum
Open/Closed:  Closed

Mon 18 Oct 2004 04:14:52 AM UTC, comment #3: 

fixed in cvs

Thong Nguyen <tum>
Group Member
Mon 18 Oct 2004 04:14:27 AM UTC, comment #2: 

fixed in cvs

Thong Nguyen <tum>
Group Member
Mon 18 Oct 2004 03:40:44 AM UTC, comment #1: 

Good catch.

Remember that you need to handle assigning null to valuetype fields too.

I'll fix this soon.

Thong Nguyen <tum>
Group Member
Sun 17 Oct 2004 10:36:33 AM UTC, original submission:  

When a null-value is set via SetValue() the VM bails out
with a SegFault. This is because the check for assignment
compatibility is done for null-value, too.

Suggested fix (sorry, no time for a propper diff-patch):
replace the following code at the end of _IL_ClrField_SetValueInternal()

objectType = ILClassToType(GetObjectClass(value));

if(!ILTypeAssignCompatible(ILProgramItem_Image(field), objectType, type))
{
  ILExecThreadThrowSystem(thread, "System.ArgumentException", 0);
  return;
}

/* Fetch the value, box it, and return */
if(ILTypeIsReference(type))
{
  ((ILObject *)ptr) = value;
}
else
{
  ILExecThreadUnbox(thread, type, value, ptr);
}

WITH

if(value == NULL) {
  // if the value is NULL just set it
  ((ILObject *)ptr) = value;
} else {
  [the above code]
}


Andre Seidelt <Ilu>

 

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

No files currently attached

 

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-10-18 tum Open/ClosedOpen Closed
2004-10-18 tum StatusNone Fixed
2004-10-18 tum Assigned toNone tum

Back to the top

Powered by Savane 3.13-02a9.
Corresponding source code