grijjy / GrijjyCloudLogger

GrijjyCloudLogger, remote logging for Windows, iOS, Android, macOS and Linux
Other
107 stars 29 forks source link

Range Check Error in TgoProtocolBuffer.TWriter #3

Closed ByteArts closed 7 years ago

ByteArts commented 7 years ago

Using Delphi 10.1 Seattle, compiling for Win32 with Range Checking turned on generates range check exceptions in the TgoProtocolBuffer.TWriter methods, specifically on this operation:

ZigZag := AValue shl 1; <- when the exception happens, AValue has a value of -1

To duplicate this issue, just make a new, blank Firemonkey app (I haven't tried it with VCL, but I think it would have the same issue), and add this code to a button click or other event:

GrijjyLog.Connect('tcp://localhost:7337', ''); <- Range Check exception happens here

ByteArts commented 7 years ago

I can fix this particular error, but then there are numerous other places that generate range check exceptions.

grijjy commented 7 years ago

I have made changes to prevent a couple of range check errors. Probably didn't get them all. These range check errors aren't really errors and the behavior is as it should be. For this reason, we never compile with range checking turned on. But you are correct that it should work with range checking enabled, so please let us know if you find any other instances.

Please note that the changes are made in the GrijjyFoundation repository.

ByteArts commented 7 years ago

I've confirmed that the range check errors are now fixed, but now I'm getting overflow check errors. I'll report this as a separate issue since, well, it is one.