Closed anderbelluno closed 2 years ago
The integer overflow error appears for me. This did not happen in Delphi 10.4.2
@flrizzato the error was also raising on my environment, so I made a fork to fix it. Let's see if it is ok. Could you try it on iOS, please? https://github.com/igorbastosib/ZXing.Delphi I'll send a pull request to the original project as soon as you feedback me.
Thank you
I'm a little bit worried with the fact you both are seeing this issue but I can't reproduce it on my environment for both Android and iOS. Have you identified the potential cause in the library source code?
@flrizzato unfortunately we are not the only ones who faced this issue. I've seen few Devs on Social Media complaining about it...
I'm not that technical to understand the "why", sorry, I just found where was raising the issue and 'fixed' it though:
Lib/Classes/Common/ZXing.Common.BitArrayImplementation.pas Function: function TBitArrayImplementation.GetBits, line with: currentBits := currentBits and (not((1 shl (from and $1F)) - 1)); AND two places on TBitArrayImplementation.InitLookup... I added the {$OVERFLOWCHECKS OFF} before and {$OVERFLOWCHECKS ON} after to 'fix' it
Are you testing in debug mode?
So, maybe the issue was present in 10.4 but not visible...
hahahah To be honest Darian Miller sent me this article yesterday, so I haven't truly fixed anything at all. At least the code I added is gonna disable it even if the DEV doesn't read the article (which was my case and so many others).
This change affects only "debug mode", so building in "release mode" before deploying will have the same results. Anyway, the core issue deserves more investigation, I will try asap.
Please, do so.
As said here I just changed 2 places (the whole code is different because I'm used to press CtrlD every single time... sorry
@flrizzato unfortunately we are not the only ones who faced this issue. I've seen few Devs on Social Media complaining about it...
I'm not that technical to understand the "why", sorry, I just found where was raising the issue and 'fixed' it though:
Lib/Classes/Common/ZXing.Common.BitArrayImplementation.pas Function: function TBitArrayImplementation.GetBits, line with: currentBits := currentBits and (not((1 shl (from and $1F)) - 1)); AND two places on TBitArrayImplementation.InitLookup... I added the {$OVERFLOWCHECKS OFF} before and {$OVERFLOWCHECKS ON} after to 'fix' it
Just did a "Pull Request" 'fixing' this situation. Let's see when @Spelt is going to review it šš
Thanks,
I hope I can do it this month. Iām unfortunately a bit stressed for time. I hope I can take a look at it at the end of this month.
Op 5 dec. 2021 om 11:26 heeft Igor @.***> het volgende geschreven:
ļ»æ Just did a "Pull Request" 'fixing' this situation. Let's see when @Spelt is going to review it šš
ā You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.
No worries, you will notice there is no that much changes: I just added 4 lines turning OFF and ON the IntergerOverflow, I also added some changes on the Demo\aTestAPP, because some stuff has changed on D11. Take your time š
Thank you, Igor de Bastos Costa
De: E Spelt @.> Enviado: segunda-feira, 6 de dezembro de 2021 18:24 Para: Spelt/ZXing.Delphi @.> Cc: Igor @.>; Comment @.> Assunto: Re: [Spelt/ZXing.Delphi] Delphi 11 compatibility (Issue #123)
Thanks,
I hope I can do it this month. Iām unfortunately a bit stressed for time. I hope I can take a look at it at the end of this month.
Op 5 dec. 2021 om 11:26 heeft Igor @.***> het volgende geschreven:
ļ»æ Just did a "Pull Request" 'fixing' this situation. Let's see when @Spelt is going to review it šš
ā You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.
ā You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/Spelt/ZXing.Delphi/issues/123#issuecomment-986989619, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACG2RAB7NINZDGAAP3QTKHLUPTWVTANCNFSM5GVKQNTA. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
I could not reproduce this. I have improved the source a bit for better protection. I also have {$OVERFLOWCHECKS OFF} added.
I've just tested with RAD 11 and everything is working fine for Android 11 and iOS 15.1