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

Allow getting source slices smaller than source area #810

Merged
merged 1 commit into from
Apr 17, 2019
Merged

Allow getting source slices smaller than source area #810

merged 1 commit into from
Apr 17, 2019

Conversation

ChristopherHogan
Copy link
Contributor

Fixes #669. The line if (iloc < slice_imin || iloc > slice_imax) continue; wasn't having the desired effect because ivec::operator> (and <) only returns true if every dimension is strictly greater (or less). That means ivec{151, 153} > ivec{151, 151} returns false (which caused writing past the end of an array).
@stevengj @oskooi

@ChristopherHogan ChristopherHogan changed the title Allow getting source clices smaller than source area Allow getting source slices smaller than source area Apr 10, 2019
@stevengj stevengj merged commit 04f2948 into NanoComp:master Apr 17, 2019
bencbartlett pushed a commit to bencbartlett/meep that referenced this pull request Sep 9, 2021
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.

get_source_slice produces segmentation fault when slice area is smaller than source area
2 participants