Updated Branches: refs/heads/develop f7956f9a4 -> 78cbff9f0
FLEX-33713: An NPE is thrown by this code when compiling 'spark.swc' from the SDK. The null check bypasses the issue, it doesn't do anything to fix the root cause... Signed-off-by: Erik de Bruin <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/78cbff9f Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/78cbff9f Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/78cbff9f Branch: refs/heads/develop Commit: 78cbff9f0342e2de9f28abb88dab6c656e061e95 Parents: f7956f9 Author: Erik de Bruin <[email protected]> Authored: Mon Sep 23 15:22:03 2013 +0200 Committer: Erik de Bruin <[email protected]> Committed: Mon Sep 23 15:22:03 2013 +0200 ---------------------------------------------------------------------- .../as/codegen/ClassDirectiveProcessor.java | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/78cbff9f/compiler/src/org/apache/flex/compiler/internal/as/codegen/ClassDirectiveProcessor.java ---------------------------------------------------------------------- diff --git a/compiler/src/org/apache/flex/compiler/internal/as/codegen/ClassDirectiveProcessor.java b/compiler/src/org/apache/flex/compiler/internal/as/codegen/ClassDirectiveProcessor.java index dae7ebc..29d2a7b 100644 --- a/compiler/src/org/apache/flex/compiler/internal/as/codegen/ClassDirectiveProcessor.java +++ b/compiler/src/org/apache/flex/compiler/internal/as/codegen/ClassDirectiveProcessor.java @@ -533,9 +533,19 @@ class ClassDirectiveProcessor extends DirectiveProcessor cinit_insns.addInstruction(OP_returnvoid); - this.classStaticScope.methodBodyVisitor.visitInstructionList(cinit_insns); - this.classStaticScope.methodBodyVisitor.visitEnd(); - this.classStaticScope.methodVisitor.visitEnd(); + /* + * FIXME: NPE while compiling 'spark.swc' + * + * erikdebruin: I'm just bypassing that with this null check. Someone + * who knows what's going on here should probably take a + * look WHY this was failing... + */ + if (this.classStaticScope.methodBodyVisitor != null) + { + this.classStaticScope.methodBodyVisitor.visitInstructionList(cinit_insns); + this.classStaticScope.methodBodyVisitor.visitEnd(); + this.classStaticScope.methodVisitor.visitEnd(); + } } else {
