From 9e4fc8e03a0b44032ee399f1b07e45d17d2ddd77 Mon Sep 17 00:00:00 2001
From: Melanie Thielker
Date: Thu, 6 Nov 2008 23:10:49 +0000
Subject: Mantis #2571 Thank you, idb, for a patch that fixes the jump function
in LSL.
---
OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs | 7 +++++++
OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs | 4 ++--
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs
index 6e56231..25c823d 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs
@@ -194,5 +194,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
{
SetVars(m_InitialValues);
}
+
+ public void NoOp()
+ {
+ // Does what is says on the packet. Nowt, nada, nothing.
+ // Required for insertion after a jump label to do what it says on the packet!
+ // With a bit of luck the compiler may even optimize it out.
+ }
}
}
diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs
index 795d38f..37d29f7 100644
--- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs
@@ -474,7 +474,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
/// String containing C# code for JumpLabel jl.
private string GenerateJumpLabel(JumpLabel jl)
{
- return Generate(String.Format("{0}:\n", jl.LabelName), jl);
+ return Generate(String.Format("{0}:", CheckName(jl.LabelName)), jl) + " NoOp();\n";
}
///
@@ -484,7 +484,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
/// String containing C# code for JumpStatement js.
private string GenerateJumpStatement(JumpStatement js)
{
- return Generate(String.Format("goto {0}", js.TargetName), js);
+ return Generate(String.Format("goto {0}", CheckName(js.TargetName)), js);
}
///
--
cgit v1.1