QB64.org Forum

Active Forums => QB64 Discussion => Topic started by: hanness on June 07, 2021, 03:51:05 am

Title: Compiler Fails in the June 7, 2021 Development Build of QB64
Post by: hanness on June 07, 2021, 03:51:05 am
I have a program that compiles without difficulty on the May 22, 2021 Dev Build but the exact same code fails to compile on the June 7 release.

Error received:

Compiler error (check for syntax errors) (Subscript out of range:9-12075) on line 31 (click here or Ctrl+Shift+G to jump there)

Contents of line 31:

$ExeIcon:'iso.ico'

Note that if I comment out line 31, I will continue to get the same error but without a reference to any line number.

The program is 10,000+ lines so I won't post the whole thing here, but here are the first 45 lines of code so that you can see that line 31 in context:

   
Code: QB64: [Select]
  1. ' WIM (Windows Image Manager) Tools
  2. ' (c) 2021 by Hannes Sehestedt
  3.  
  4. ' Release notes can be found at the very end of the program
  5.  
  6. ' This program is intended to be run on Windows 10 x64 and should be compiled with the 64-bit version of QB64.
  7. ' The program is currently tested and compiled on QB64 version 1.5, May 22, 2021 Development Build.
  8. ' IMPORTANT: It is very important to use the March 17, 2021 Dev Build or newer as this fixes a bug with the
  9. ' CLEAR command.
  10.  
  11.  
  12.  
  13. ' This program needs to be run elevated. Check to see if the program is running elevated, if not,
  14. ' restart in elevated mode and terminate current non-elevated program.
  15.  
  16. If (_ShellHide(">nul 2>&1 " + Chr$(34) + "%SYSTEMROOT%\system32\cacls.exe" + Chr$(34) + " " + Chr$(34) + "%SYSTEMROOT%\system32\config\system" + Chr$(34))) <> 0 Then
  17.     Shell "powershell.exe Start-Process '" + (Mid$(Command$(0), _InStrRev(Command$(0), "\") + 1)) + "' -Verb runAs"
  18.     System
  19.  
  20. ' If we reach this point then the program was run elevated.
  21.  
  22. ' ********************************************************
  23. ' ** Make sure to keep the "$VersionInfo" updated below **
  24. ' ********************************************************
  25.  
  26. ' Perform some initial setup for the program
  27.  
  28. $ExeIcon:'iso.ico'
  29. $VersionInfo:CompanyName=Hannes Sehestedt
  30. $VersionInfo:FILEVERSION#=16,3,5,137
  31. $VersionInfo:ProductName=WIM Tools
  32. $VersionInfo:LegalCopyright=(c) 2021 by Hannes Sehestedt
  33. Width 120, 30
  34.  
  35. BeginProgram:
  36.  
  37. Print "Initializing program. Standby..."
  38.    

Note that as a test, I removed lines 30 through 39 from the program just as a test to see if any of those lines near line 31 are the cause of the error but the compiler still fails.

Other info:

Help / About Info in QB64:

QB64 Version 1.51
Development Build
From git 0a48450

I'm running the 64-bit version of QB64 on Windows 10 21H1.

Some of the main system specs on which testing was performed:

ASUS Prime Z590-A Motherboard
Intel Core i7-11700K CPU (11th Gen)
128GB RAM
1 x 1TB NVMe SSD
1 x 2TB NVMe SSD
2 x 8TB WD NAS HDs

If you need any other info, please do let me know.

- Hannes

Title: Re: Compiler Fails in the June 7, 2021 Development Build of QB64
Post by: hanness on June 07, 2021, 03:57:38 am
My apologies, I should have tried this before, but I tried to compile a simple one line program and get the same error.

Literally, this was the whole program:

print "Hello"

So there seems to be some fundamental issue with that build.
Title: Re: Compiler Fails in the June 7, 2021 Development Build of QB64
Post by: hanness on June 07, 2021, 01:40:12 pm
Just an update to note that the same issue is still present in the 03bb0db build.
Title: Re: Compiler Fails in the June 7, 2021 Development Build of QB64
Post by: SpriggsySpriggs on June 07, 2021, 02:31:20 pm
@hanness Something seems to have happened with the GitHub build system. Fellippe and I have been looking into it.
Title: Re: Compiler Fails in the June 7, 2021 Development Build of QB64
Post by: Cobalt on June 07, 2021, 05:17:13 pm
And people wonder why I use older versions....
Title: Re: Compiler Fails in the June 7, 2021 Development Build of QB64
Post by: hanness on June 07, 2021, 05:21:38 pm
Thanks for looking into it. I simply happened to notice that there was a new dev build and thought I would test it purely out of curiosity and not driven by any specific need or issue.

I typically try to run on a released version of QB64 but there was a build in March that actually fixed an issue I had so that dev build is my base starting point.
Title: Re: Compiler Fails in the June 7, 2021 Development Build of QB64
Post by: NOVARSEG on June 08, 2021, 01:34:21 am
OPTION BASE 1
DIM A(2) AS INTEGER


FOR x = 0 TO 2

    A(x) = 10
NEXT x
'ERROR      subscript out of range

Title: Re: Compiler Fails in the June 7, 2021 Development Build of QB64
Post by: SMcNeill on June 08, 2021, 02:08:11 am
OPTION BASE 1
DIM A(2) AS INTEGER


FOR x = 0 TO 2

    A(x) = 10
NEXT x
'ERROR      subscript out of range

What’s wrong with the above?  By your code, I’d expect such results.

DIM A(0 TO 2) AS INTEGER will fix your problem.
Title: Re: Compiler Fails in the June 7, 2021 Development Build of QB64
Post by: NOVARSEG on June 08, 2021, 02:58:07 am
Hi Steve

Yep , but it is easy to make a mistakes with FOR NEXT loops etc.

Title: Re: Compiler Fails in the June 7, 2021 Development Build of QB64
Post by: SpriggsySpriggs on June 08, 2021, 11:01:04 am
OPTION BASE 1
DIM A(2) AS INTEGER


FOR x = 0 TO 2

    A(x) = 10
NEXT x
'ERROR      subscript out of range
@NOVARSEG
That isn't a compilation error. That's an error at runtime.
Title: Re: Compiler Fails in the June 7, 2021 Development Build of QB64
Post by: hanness on June 14, 2021, 12:45:24 am
Low priority as I can use a previous Dev build, but was just curious to know whether anything cause has yet been determined for compile errors with the current dev build.
Title: Re: Compiler Fails in the June 7, 2021 Development Build of QB64
Post by: hanness on June 18, 2021, 10:25:51 pm
The June 14th dev build seems to resolve this issue.