-
Notifications
You must be signed in to change notification settings - Fork 28
Fix runtime error inside m3quake QScanner #1024
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Fix runtime error inside m3quake QScanner #1024
Conversation
Fix runtime error inside m3quake QScanner
...
***
*** runtime error:
*** An enumeration or subrange value was out of range.
*** file "../src/QScanner.m3", line 49
***
*** execution of [<function _BuildGlobalFunction at 0x0000000002F2DD68>, <function _ShipFunction at 0x0000000002F2DDD8>] failed ***
...
...
t.buflen := M3File.Read (f, t.buffer^, size); (* VVM: it is line 49 *)
...
|
Are you sure you have everything up to date? |
|
} I don't think this is the right fix.
It do not "bad things". But I am not sure that it ( path) do "good things"
… 19.04.2022, 13:51, "Jay Krell" ***@***.******@***.*** commented on this pull request.In m3-sys/m3quake/src/QScanner.m3:> @@ -46,7 +46,7 @@ PROCEDURE Init (t: T; f: File.T; map: Quake.IDMap): T =
DO
size := VAL(stat.size, INTEGER);
t.buffer := NEW (REF ARRAY OF CHAR, MAX (0, size) + 1);
- t.buflen := M3File.Read (f, t.buffer^, size);
What is size when this fails? Is it negative? I don't think this is the right fix.
|
|
19.04.2022, 13:49, "Jay Krell" ***@***.***>:
Are you sure you have everything up to date?It seems like you are hitting things I already fixed, like the slashes (long ago, not today).In this case, the problem I hit months ago when first running DJGPP is that stat.size does not account for text conversion (\r\n to \n) and reading does, so the sizes would mismatch. Open should always be binary. I thought I made it so. Maybe I missed some.I don't think this is the right fix.The right fix is to always open binary.I agree it is wonky.
} I don't think this is the right fix.
Yes. In best case it is "temporary fix".
} fixed, like the slashes (long ago, not today).
I remember this fix. ( May be 'this', I am not sure)
} DJGPP
This patch also for other MinGw targets
} text conversion (\r\n to \n)
It is news for me. In this case "sizes would mismatch" of course . . .
|
|
@VictorMiasnikov this can be closed now right? |
This patch ( in any key) is part of: Nothing terrible happened with: But this patch is not be "a way to real solving of problem" ;-( |
Fix runtime error inside m3quake QScanner
...
*** runtime error:
*** An enumeration or subrange value was out of range.
*** file "../src/QScanner.m3", line 49
*** execution of [<function _BuildGlobalFunction at 0x0000000002F2DD68>, <function _ShipFunction at 0x0000000002F2DDD8>] failed ***
...
...
t.buflen := M3File.Read (f, t.buffer^, size); (* VVM: it is line 49 *)
...