Skip to content

Compiler crashes with -XsoycDetailed #9602

Closed

Description

@aepshteyn

GWT version: 2.8.2
Browser (with version): N/A
Operating System: Windows 8.1


Description

When using the flags -compileReport -XcompilerMetrics -XsoycDetailed, the
compiler fails with java.util.EmptyStackException
at com.google.gwt.core.ext.soyc.impl.StoryRecorder.analyzeFragment(StoryRecorder.java:179)

The code responsible for this is at StoryRecorder.java:179:

        while (!dependencyScope.peek().range.contains(range)) {
          popAndRecord(dependencyScope, fragment);
        }

It's trying to peek() from an empty stack. The solution might be as simple as adding a check for isEmpty(), like this:

        while (!dependencyScope.isEmpty() && !dependencyScope.peek().range.contains(range)) {
          popAndRecord(dependencyScope, fragment);
        }
Steps to reproduce

Do a compile with the flags -compileReport -XcompilerMetrics -XsoycDetailed

Known workarounds

Don't use the -XsoycDetailed flag

Links to further discussions

Stack Overflow question "Maven Compilation for GWT 2.7 SOYC Fails"

Activity

  1. added a commit that references this issue on Apr 8, 2023
    9a35798
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions