Skip to content

abort get_dft_array if user-supplied frequency index is invalid#1373

Merged
stevengj merged 1 commit intoNanoComp:masterfrom
oskooi:freq_array_error
Oct 2, 2020
Merged

abort get_dft_array if user-supplied frequency index is invalid#1373
stevengj merged 1 commit intoNanoComp:masterfrom
oskooi:freq_array_error

Conversation

@oskooi
Copy link
Collaborator

@oskooi oskooi commented Sep 23, 2020

Currently, if the frequency index parameter num_freq of get_dft_array is outside the valid range (e.g., if num_freq is larger than the size of the array), the function returns an array of zero values which is incorrect. This PR adds a check in dft_chunk::process_dft_component to verify that num_freq is valid, otherwise it aborts with an error.

@stevengj
Copy link
Collaborator

stevengj commented Oct 2, 2020

(Following this comment: #1368 (comment))

@stevengj stevengj merged commit a37fc3e into NanoComp:master Oct 2, 2020
@oskooi oskooi deleted the freq_array_error branch October 2, 2020 02:04
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants