-
Notifications
You must be signed in to change notification settings - Fork 142
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fbc: fix compiler fault when accessing this.member
- where member is incorrectly inherited from a namespace (i.e. not derived from UDT) - report 'Element not defined' instead Example: Namespace M Sub ok() : Print "OK" : End Sub End Namespace Type UDT Declare Sub test() Dim As Integer __ End Type Sub UDT.test() Using M This.ok() '' <<< --- segfault in fbc-1.08 and earlier End Sub
- Loading branch information
Showing
4 changed files
with
162 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
' TEST_MODE : COMPILE_ONLY_FAIL | ||
|
||
dim shared as zstring * 32 duplicate = " ..duplicate" | ||
|
||
namespace m | ||
dim as zstring *32 duplicate = " m.duplicate" | ||
end namespace | ||
|
||
type udt extends object | ||
declare sub test() | ||
end type | ||
|
||
sub udt.test() | ||
using m | ||
print this.duplicate '' expected: element not defined | ||
end sub | ||
|
||
print "from type:" | ||
dim as udt u | ||
u.test() | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
' TEST_MODE : COMPILE_ONLY_FAIL | ||
|
||
sub duplicate() | ||
print " ..duplicate" | ||
end sub | ||
|
||
namespace m | ||
sub duplicate() | ||
print " m.duplicate" | ||
end sub | ||
end namespace | ||
|
||
type udt extends object | ||
declare sub test() | ||
end type | ||
|
||
sub udt.test() | ||
using m | ||
this.duplicate() '' expected: element not defined | ||
end sub | ||
|
||
print "from type:" | ||
dim as udt u | ||
u.test() | ||