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

Fix bug with FB_List.RemoveAt #24

Closed
ahuca opened this issue Mar 8, 2023 · 0 comments · Fixed by #25
Closed

Fix bug with FB_List.RemoveAt #24

ahuca opened this issue Mar 8, 2023 · 0 comments · Fixed by #25
Assignees
Labels
bug Something isn't working

Comments

@ahuca
Copy link
Owner

ahuca commented Mar 8, 2023

IF nIdx < THIS^.nLastIdx THEN
    Tc2_System.MEMCPY(destAddr := pTmp,
                      srcAddr := ADR(pBuffer[nIdx + 1]),
                      n := TO_UDINT(THIS^.nLastIdx - nIdx)*THIS^.nItemSize);
END_IF

At line 15, the statement destAddr := pTmp is actually incorrect, this time pTmp should start from an offset whose size is equivalent to the previously copied memory.

@ahuca ahuca added the bug Something isn't working label Mar 8, 2023
@ahuca ahuca self-assigned this Mar 8, 2023
ahuca added a commit that referenced this issue Mar 8, 2023
ahuca added a commit that referenced this issue Mar 8, 2023
@ahuca ahuca linked a pull request Mar 8, 2023 that will close this issue
@ahuca ahuca closed this as completed in #25 Mar 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant