Skip to content

Commit

Permalink
Very crude stack trace support for interpreted mode. Prevents some er…
Browse files Browse the repository at this point in the history
…rors, though.

(E.g. for "erlang:halt()" in interpreted mode.)
  • Loading branch information
esstrifork committed Jan 27, 2014
1 parent 75fe296 commit f8e666e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/main/java/erjang/ErlangException.java
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,18 @@ private static ETuple4 decodeTraceElem(StackTraceElement st) {
mname.equals("invoke"))
return null;

if (mname.equals("interpret") &&
cname.equals("erjang.beam.interpreter.Interpreter$Module$Function"))
{
ETuple4 res = new ETuple4();
res.elem1 = EAtom.intern("<interpreted>");
res.elem2 = EAtom.intern("<interpreted>");
res.elem3 = new ESmall(-1);
res.elem4 = EList.make(new ETuple2(am_file, new EString("<unknown>")),
new ETuple2(am_line, ERT.box(st.getLineNumber())));
return res;
}

Class<?> clazz = null;
try {
clazz = Class.forName(cname);
Expand Down

0 comments on commit f8e666e

Please sign in to comment.