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:UE.TArray(0) 使用 int32表示值,添加大于 int32.maxvalue 造成溢出 #639

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fanxiao92
Copy link

Lua中使用 long long 类型表示 integer,这里是否调整为GetInt64Property 更能匹配lua中的类型定义?

local array = UE.TArray(0)
array:Add(1024)
array:Add(math.maxinteger)
array:Add(math.mininteger)
UE.UTutorialBlueprintFunctionLibrary.CallLuaByGlobalTable(array)

在c++中的CallLuaByGlobalTable 获取到 array的值将分别为 1024 4294967295 0造成溢出的情况。

@tencent-adm
Copy link
Member

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


xiao fan seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@crazytuzi
Copy link
Contributor

crazytuzi commented Nov 18, 2023

这里默认int32也算符合设计,毕竟绝大部分需求都是int32类型就够了,默认调整为int64的话,会导致其他业务场景内存变大,可以通过另外一个分支来特殊支持int64

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

Successfully merging this pull request may close these issues.

3 participants