Skip to content

Commit cf0bb8a

Browse files
committed
Fix check for number of primitives
1 parent 1c87794 commit cf0bb8a

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

include/gauxc/util/c_basisset.hpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
*/
1212
#pragma once
1313

14+
#include <gauxc/exceptions.hpp>
1415
#include <gauxc/shell.h>
1516
#include <gauxc/shell.hpp>
1617
#include <gauxc/basisset.h>
@@ -20,11 +21,15 @@ namespace GauXC::detail {
2021
static inline BasisSet<double>* get_basisset_ptr(C::GauXCBasisSet basis) noexcept {
2122
return static_cast<BasisSet<double>*>(basis.ptr);
2223
}
23-
static inline Shell<double> convert_shell(C::GauXCShell shell, bool normalize) noexcept {
24+
static inline Shell<double> convert_shell(C::GauXCShell shell, bool normalize) {
2425
Shell<double>::prim_array alpha{};
2526
Shell<double>::prim_array coeff{};
2627
Shell<double>::cart_array O{0.0, 0.0, 0.0};
2728

29+
if (shell.nprim > detail::shell_nprim_max) {
30+
GAUXC_GENERIC_EXCEPTION("Number of primitives in shell exceeds maximum allowed");
31+
}
32+
2833
for( int32_t i = 0; i < shell.nprim; ++i ) {
2934
alpha[i] = shell.exponents[i];
3035
coeff[i] = shell.coefficients[i];

0 commit comments

Comments
 (0)