summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
e16c054)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+ /* Catch undefined behavior. */
+ if (unlikely(estack_ax_v < 0 || estack_ax_v >= 64)) {
+ ret = -EINVAL;
+ goto end;
+ }
res = (estack_bx_v >> estack_ax_v);
estack_pop(stack, top, ax, bx);
estack_ax_v = res;
res = (estack_bx_v >> estack_ax_v);
estack_pop(stack, top, ax, bx);
estack_ax_v = res;
+ /* Catch undefined behavior. */
+ if (unlikely(estack_ax_v < 0 || estack_ax_v >= 64)) {
+ ret = -EINVAL;
+ goto end;
+ }
res = (estack_bx_v << estack_ax_v);
estack_pop(stack, top, ax, bx);
estack_ax_v = res;
res = (estack_bx_v << estack_ax_v);
estack_pop(stack, top, ax, bx);
estack_ax_v = res;