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

Fixed integer overflow issue causing windows cross compile to fail #24

Merged
merged 1 commit into from Jul 20, 2020
Merged

Fixed integer overflow issue causing windows cross compile to fail #24

merged 1 commit into from Jul 20, 2020

Conversation

unitoftime
Copy link
Contributor

Hi,
Great library.

I saw that windows cross compiling was failing due to the 4GB constant overflowing the signed integer. So I changed it to use uint32 and the math package's maxUint32.

Thanks,
Jacob

Copy link
Owner

@qmuntal qmuntal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for reporting this issue and proposing a solution!

decoder.go Outdated
@@ -47,7 +48,7 @@ func Open(name string) (*Document, error) {
type Decoder struct {
ReadHandler ReadHandler
MaxExternalBufferCount int
MaxMemoryAllocation int
MaxMemoryAllocation uint32
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would rather use uint64 to support more than 4Gb quotas.

@unitoftime
Copy link
Contributor Author

unitoftime commented Jul 20, 2020

Hi,
Thanks for the feedback. I amended my previous commit to use uint64.

Thanks

@qmuntal qmuntal merged commit dc6f4c3 into qmuntal:master Jul 20, 2020
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.

None yet

2 participants