Opened 17 years ago

Closed 17 years ago

#77 closed defect (fixed)

unreachable location in matmat example

Reported by: Stephen Siegel Owned by:
Priority: major Milestone:
Component: multiple Version: 1.0
Keywords: source, location, null Cc:

Description

edu.udel.cis.vsl.minimp.model.IF.SyntaxException: Syntax error in null:
null[10]
Unreachable location

at edu.udel.cis.vsl.minimp.model.impl.Function.complete(Function.java:339)
at edu.udel.cis.vsl.minimp.model.impl.Process.complete(Process.java:122)
at edu.udel.cis.vsl.minimp.model.impl.Model.complete(Model.java:141)
at edu.udel.cis.vsl.minimp.front.minimp.ModelBuilder.processAST(ModelBuilder.java:274)
at edu.udel.cis.vsl.minimp.front.minimp.ModelBuilder.buildModel(ModelBuilder.java:161)
at edu.udel.cis.vsl.minimp.test.MatmatTest.setUpBeforeClass(MatmatTest.java:54)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.junit.internal.runners.BeforeAndAfterRunner.invokeMethod(BeforeAndAfterRunner.java:74)
at org.junit.internal.runners.BeforeAndAfterRunner.runBefores(BeforeAndAfterRunner.java:50)
at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:33)
at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:45)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)

There are a couple of problems here: first, the location has a null "source code" field. The front end should create a source code object for each location. Without it, debugging is difficult and you cannot report anything useful to the user. The source for a location should probably just be the source for the statement that departs from the location.

Second problem: maybe the model should not throw an exception if there are unreachable nodes but instead just prune them and report a warning?

Third question: what is the unreachable location in this case and why is it happening?

Change History (1)

comment:1 by ywei, 17 years ago

Resolution: fixed
Status: newclosed

Problem fixed.

Note: See TracTickets for help on using tickets.