• All submissions to this site are governed by Second Life Project Contribution Agreement. By submitting patches and other information using this site, you acknowledge that you have read, understood, and agreed to those terms.
Issue Details (XML | Word | Printable)

Key: SVC-2182
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Scouse Linden
Reporter: Francis Chung
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
2. Second Life Service - SVC

Functions that return keys cause System.InvalidProgramException

Created: 17/Apr/08 12:03 AM   Updated: 14/May/08 09:58 AM
Return to search
Component/s: Scripts
Affects Version/s: Mono Beta
Fix Version/s: None

Issue Links:
Relates
 

Linden Lab Issue ID: DEV-14507
Linden Lab Internal Branch: mono-based-on-1-20-0-server-84445


 Description  « Hide
The following code causes the script to crash for no reason:

key getKey( ) {
return NULL_KEY;
}

default {
state_entry() { llMessageLinked( LINK_SET, 18, "", "" ); }
link_message( integer sender_num, integer channel, string message, key id ) { key newKey; newKey = getKey( ); }
}

Error output:
[0:02] Object [script:New Script]: Script run-time error
[0:02] Object [script:New Script]: System.InvalidProgramException: Invalid IL code in LSL_dd7aedc1_fa98_0dc0_b564_8ccc28cce173:edefaultlink_message (int,int,string,LindenLab.SecondLife.Key): IL_0087: stloc.0

at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[])
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000]

This error is mono-specific - and does not happen with the LSL interpreter.



 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Ingmar RiversRunRed added a comment - 18/Apr/08 07:54 AM
This seems to be related to returning a key from a custom function and then assigning it to something:

key returnakey() {
return NULL_KEY;
}

default {
state_entry() { key t = returnakey(); }
}

[7:53] Object [script:New Script]: Script run-time error
[7:53] Object [script:New Script]: System.InvalidProgramException: Invalid IL code in LSL_ea65065c_d1d1_b23d_9c55_2c37c11995c7:edefaultstate_entry (): IL_007b: stloc.0

at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[])
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000]

It doesn't happen when the returned key is simply discarded, or when the key is returned directly from a system function (e.g. llGetKey).


Periapse Linden added a comment - 14/May/08 09:58 AM
passed QA