From 77be20ed57f5f1f1b6909531b392f9b99c90f0dc Mon Sep 17 00:00:00 2001 From: Volker Berlin Date: Mon, 30 Dec 2019 23:02:25 +0100 Subject: [PATCH] correct sourceFile and className on writing --- src/de/inetsoftware/jwebassembly/module/ModuleGenerator.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/de/inetsoftware/jwebassembly/module/ModuleGenerator.java b/src/de/inetsoftware/jwebassembly/module/ModuleGenerator.java index 486d5e1..9abdfca 100644 --- a/src/de/inetsoftware/jwebassembly/module/ModuleGenerator.java +++ b/src/de/inetsoftware/jwebassembly/module/ModuleGenerator.java @@ -298,6 +298,8 @@ public class ModuleGenerator { */ public void finish() throws IOException { for( Iterator it = functions.getWriteLater(); it.hasNext(); ) { + sourceFile = null; // clear previous value for the case an IO exception occur + className = null; FunctionName next = it.next(); if( next instanceof SyntheticFunctionName ) { writeMethodImpl( next, true, ((SyntheticFunctionName)next).getCodeBuilder( watParser ) ); @@ -306,6 +308,8 @@ public class ModuleGenerator { if( classFile == null ) { throw new WasmException( "Missing function: " + next.signatureName, -1 ); } else { + sourceFile = classFile.getSourceFile(); + className = classFile.getThisClass().getName(); MethodInfo method = classFile.getMethod( next.methodName, next.signature ); if( method != null ) { try {