Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public String getMessage() {
String res = super.getMessage();
if (trace != null) {
WPos pos = trace.attrSource();
res = res + "\n at " + pos.getFile() + " line " + pos.getLine();
res = res + "\n at " + pos.getFile() + ":" + pos.getLine();
}
return res;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public String getMessage() {
@Override
public String toString() {
File file = new File(source.getFile());
return errorType + " in File " + file.getName() + " line " + source.getLine() + ":\n " +
return errorType + " in File " + file.getName() + ":" + source.getLine() + ":\n " +
message;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
import de.peeeq.wurstscript.ast.WPackage;
import de.peeeq.wurstscript.intermediatelang.*;
import de.peeeq.wurstscript.jassIm.*;
import de.peeeq.wurstscript.translation.imtranslation.ImPrinter;
import de.peeeq.wurstscript.types.TypesHelper;
import de.peeeq.wurstscript.utils.Utils;
import org.eclipse.jdt.annotation.Nullable;

import java.util.ArrayList;
Expand Down Expand Up @@ -256,7 +258,7 @@ public static ILconst eval(ImVarArrayAccess e, ProgramState globalState, LocalSt
public static ILconst eval(ImMemberAccess ma, ProgramState globalState, LocalState localState) {
ILconstObject receiver = globalState.toObject(ma.getReceiver().evaluate(globalState, localState));
if (receiver == null) {
throw new InterpreterException(ma.getTrace(), "Null pointer dereference");
throw new InterpreterException(ma.getTrace(), "Null pointer dereference: " + ImPrinter.asString(ma.getReceiver()));
}
List<Integer> indexes = new ArrayList<>();
for (ImExpr i : ma.getIndexes()) {
Expand Down Expand Up @@ -411,7 +413,7 @@ public static ILaddress evaluateLvalue(ImMemberAccess va, ProgramState globalSta
}
}
if (receiver == null) {
throw new InterpreterException(va.attrTrace(), "Null pointer dereference");
throw new InterpreterException(va.attrTrace(), "Null pointer dereference: " + ImPrinter.asString(va.getReceiver()));
}
ILconstObject receiverFinal = receiver;
List<Integer> indexes =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import de.peeeq.wurstscript.intermediatelang.*;
import de.peeeq.wurstscript.jassIm.*;
import de.peeeq.wurstscript.parser.WPos;
import de.peeeq.wurstscript.translation.imtranslation.ImPrinter;
import de.peeeq.wurstscript.utils.LineOffsets;
import de.peeeq.wurstscript.utils.Utils;
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
Expand Down Expand Up @@ -106,7 +107,7 @@ public void deallocate(ILconstObject obj, ImClass clazz, Element trace) {

public void assertAllocated(ILconstObject obj, Element trace) {
if (obj == null) {
throw new InterpreterException(trace, "Null pointer dereference");
throw new InterpreterException(trace, "Null pointer dereference. The interpreter expected an object here, but found null.");
}
if (obj.isDestroyed()) {
throw new InterpreterException(trace, "Object already destroyed");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public String toString() {
}

public String print() {
return "[" + file + " line " + getLine() + "]";
return "[" + file + ":" + getLine() + "]";
}

private static final Pattern p = Pattern.compile("^.*[/\\\\]([^/\\\\]+)\\.[^.]*$");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public String toString() {
if (!first) {
s.append(", ");
}
s.append(t.getName()).append(" line ").append(t.getSource().getLine());
s.append(t.getName()).append(":").append(t.getSource().getLine());
first = false;
}
s.append(">");
Expand Down
Loading