Skip to content

Commit 3308262

Browse files
committed
Merge commit '242ccfaef86ab3ab6a5f3c19f3396cdbc1049968'
2 parents 58e13d1 + 242ccfa commit 3308262

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

‎gitstatus/mbuild‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,9 @@
9494
setopt no_unset extended_glob pipe_fail prompt_percent typeset_silent \
9595
no_prompt_subst no_prompt_bang pushd_silent warn_create_global
9696

97-
if [[ $ZSH_VERSION != (5.<1->*|<6->.*) || $ZSH_VERSION == 5.4(|.*) ]]; then
97+
autoload -Uz is-at-least
98+
99+
if ! is-at-least 5.1 || [[ $ZSH_VERSION == 5.4.* ]]; then
98100
print -ru2 -- "[error] unsupported zsh version: $ZSH_VERSION"
99101
return 1
100102
fi

‎gitstatus/src/arena.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include <type_traits>
2828
#include <vector>
2929

30+
#include "check.h"
3031
#include "string_view.h"
3132

3233
namespace gitstatus {
@@ -94,6 +95,7 @@ class Arena {
9495
template <class T>
9596
inline T* Allocate(size_t n) {
9697
static_assert(!std::is_reference<T>(), "");
98+
CHECK(n <= SIZE_MAX / sizeof(T)) << n;
9799
return static_cast<T*>(Allocate(n * sizeof(T), alignof(T)));
98100
}
99101

0 commit comments

Comments
 (0)