Skip to content
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

Logical error #111

Open
status-kvo opened this issue Oct 7, 2022 · 1 comment
Open

Logical error #111

status-kvo opened this issue Oct 7, 2022 · 1 comment

Comments

@status-kvo
Copy link

unit Quick.Threads;

function TThreadedQueueCS.PopItem(var AQueueSize: Integer; var AItem: T): TWaitResult;

before the line
AItem := FQueue[FQueueOffset];

need to add array size check
if (FQueueOffset >= Length(FQueue)) then Exit;

otherwise an error occurs
Exception class $C0000005 with message 'c0000005 ACCESS_VIOLATION'.
string: AItem := FQueue[FQueueOffset];

watch Length(FQueue) = 0;
watch FQueueOffset = 60;

@exilon
Copy link
Owner

exilon commented Oct 14, 2022

Which version are you using?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants