Commit 6afa932
committed
Java bytecode front-end: fix main method detection
When parsing Java classes with just a class name (without method signature),
JBMC was incorrectly using `resolve_friendly_method_name` which could report
'main method is ambiguous' errors. This fix checks if `config.main` contains
a method signature (has a colon) and handles simple class names separately
by looking for the standard main method signature directly.
This aligns the Java front-end with Java's specification, where only
`public static void main(String[] args)` is recognized as a valid
program entry point.
Fixes: #7591 parent 4fe3ade commit 6afa932
File tree
4 files changed
+69
-12
lines changed- jbmc
- regression/jbmc/main-method-ambiguity
- src/java_bytecode
4 files changed
+69
-12
lines changedBinary file not shown.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
555 | 555 | | |
556 | 556 | | |
557 | 557 | | |
558 | | - | |
559 | | - | |
560 | | - | |
| 558 | + | |
561 | 559 | | |
562 | | - | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
563 | 563 | | |
564 | | - | |
565 | | - | |
566 | | - | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
567 | 582 | | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
568 | 589 | | |
569 | | - | |
570 | | - | |
571 | | - | |
572 | | - | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
573 | 596 | | |
574 | | - | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
575 | 604 | | |
576 | 605 | | |
577 | 606 | | |
| |||
0 commit comments