mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-06-28 16:41:01 +03:00
Catch by reference not value
This commit is contained in:
parent
30f93634b8
commit
7bcb58dea0
@ -262,7 +262,7 @@ hs_compile_multi_int(const char *const *expressions, const unsigned *flags,
|
||||
e.hasIndex ? (int)e.index : -1);
|
||||
return HS_COMPILER_ERROR;
|
||||
}
|
||||
catch (std::bad_alloc) {
|
||||
catch (const std::bad_alloc &) {
|
||||
*db = nullptr;
|
||||
*comp_error = const_cast<hs_compile_error_t *>(&hs_enomem);
|
||||
return HS_COMPILER_ERROR;
|
||||
@ -399,7 +399,7 @@ hs_error_t hs_expression_info_int(const char *expression, unsigned int flags,
|
||||
*error = generateCompileError(e);
|
||||
return HS_COMPILER_ERROR;
|
||||
}
|
||||
catch (std::bad_alloc) {
|
||||
catch (std::bad_alloc &) {
|
||||
*error = const_cast<hs_compile_error_t *>(&hs_enomem);
|
||||
return HS_COMPILER_ERROR;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user