lkml.org 
[lkml]   [2019]   [Sep]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/3] perf, expr: Remove assert usage
Date
From: Andi Kleen <ak@linux.intel.com>

My "compile perf statically" setup doesn't like this assert
for unknown reasons. Replace it with a standard BUG_ON

Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
tools/perf/util/expr.y | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/perf/util/expr.y b/tools/perf/util/expr.y
index f9a20a39b64a..5086a941295a 100644
--- a/tools/perf/util/expr.y
+++ b/tools/perf/util/expr.y
@@ -6,7 +6,6 @@
#define IN_EXPR_Y 1
#include "expr.h"
#include "smt.h"
-#include <assert.h>
#include <string.h>

#define MAXIDLEN 256
@@ -172,7 +171,8 @@ static int expr__lex(YYSTYPE *res, const char **pp)
void expr__add_id(struct parse_ctx *ctx, const char *name, double val)
{
int idx;
- assert(ctx->num_ids < MAX_PARSE_ID);
+
+ BUG_ON(ctx->num_ids >= MAX_PARSE_ID);
idx = ctx->num_ids++;
ctx->ids[idx].name = name;
ctx->ids[idx].val = val;
--
2.21.0
\
 
 \ /
  Last update: 2019-09-24 01:35    [W:0.180 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site