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

自动生成代码结构体对齐 #85

Open
caniouff opened this issue Nov 27, 2023 · 0 comments
Open

自动生成代码结构体对齐 #85

caniouff opened this issue Nov 27, 2023 · 0 comments

Comments

@caniouff
Copy link

复现方式:
添加一个NetMulticast的UFunction如下
image

在服务器多次调用,在客户端会出现Crash。

原因:
FTransform中的FQuat添加了对齐,MS_ALIGN(16) struct FQuat(见Quat.h)
而自动生成代码的FCopy_FQuat没有添加。导致FTransformFCopy_FTransform对齐不一致。
image

在写入到参数结构体时,参数结构体的偏移是UE结构体的偏移,而实际创建的结构是以FCopy_XXX为基础的。
正常情况写入FTransform参数的偏移应该是以自动生成代码为准,偏移为4,结果是用的UE结构体的偏移,16。导致写入时写越界了,覆盖了系统中其它变量的内存的值,导致crash。

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

1 participant