Commit 829b2d92 authored by Lukáš Marek's avatar Lukáš Marek

Fixed exception type + more message modifications

parent b1cd012f
......@@ -300,9 +300,11 @@ public class WeavingCode {
// index should be less than the stack height
if (operand >= basicframe.getStackSize() || operand < 0) {
throw new DiSLFatalException("Illegal access of index "
+ operand + " on a stack with "
+ basicframe.getStackSize() + " operands");
throw new DynamicInfoException(
"Dynamic context wrong access." +
" Access out of bounds. Accessed " + operand +
", but the size of stack is "
+ basicframe.getLocals());
}
// Type checking
......@@ -310,7 +312,7 @@ public class WeavingCode {
operand).getType();
if (t.getSort() != targetType.getSort()) {
throw new DiSLFatalException(
throw new DynamicInfoException(
"Dynamic context wrong access. Requested \"" +
t + "\" but found \"" + targetType
+ "\" on the stack.");
......@@ -344,8 +346,10 @@ public class WeavingCode {
// index should be less than the size of local variables
if (slot >= basicframe.getLocals() || slot < 0) {
throw new DiSLFatalException("Illegal access of index "
+ slot + " while the size of local variable is "
throw new DynamicInfoException(
"Dynamic context wrong access." +
" Access out of bounds. Accessed " + slot +
", but the size of stack is "
+ basicframe.getLocals());
}
......@@ -353,7 +357,7 @@ public class WeavingCode {
Type targetType = basicframe.getLocal(slot).getType();
if (t.getSort() != targetType.getSort()) {
throw new DiSLFatalException(
throw new DynamicInfoException(
"Dynamic context wrong access. Requested \"" +
t + "\" but found \"" + targetType
+ "\" on the stack.");
......@@ -375,8 +379,10 @@ public class WeavingCode {
// index should be less than the size of local variables
if (operand >= basicframe.getLocals() || operand < 0) {
throw new DiSLFatalException("Illegal access of index "
+ operand + " while the size of local variable is "
throw new DynamicInfoException(
"Dynamic context wrong access." +
" Access out of bounds. Accessed " + operand +
", but the size of stack is "
+ basicframe.getLocals());
}
......@@ -384,7 +390,7 @@ public class WeavingCode {
Type targetType = basicframe.getLocal(operand).getType();
if (t.getSort() != targetType.getSort()) {
throw new DiSLFatalException(
throw new DynamicInfoException(
"Dynamic context wrong access. Requested \"" +
t + "\" but found \"" + targetType
+ "\" on the stack.");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment