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()

Submitted by:  Andre Seidelt <Ilu>
Submitted on:  Sun 17 Oct 2004 10:36:33 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: Thong Nguyen <tum>
Open/Closed: Closed

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

fixed in cvs

Thong Nguyen <tum>
Project MemberIn charge of this item.
Mon 18 Oct 2004 04:14:27 AM UTC, comment #2:

fixed in cvs

Thong Nguyen <tum>
Project MemberIn charge of this item.
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>
Project MemberIn charge of this item.
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>

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follow 3 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Mon 18 Oct 2004 06:04:34 AM UTCtumOpen/ClosedOpen=>Closed
Mon 18 Oct 2004 04:14:52 AM UTCtumStatusNone=>Fixed
Mon 18 Oct 2004 03:40:44 AM UTCtumAssigned toNone=>tum

Back to the top


Powered by Savane 3.1-cleanup1