X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/bee3400ba6e1daeca869db8753dc4d86bcda28ca..ce6136d5f1a9ce68cfa6c968c257bd6c00c531d7:/src/xbt/backtrace_windows.c diff --git a/src/xbt/backtrace_windows.c b/src/xbt/backtrace_windows.c index 0b2167c838..5b6b98e229 100644 --- a/src/xbt/backtrace_windows.c +++ b/src/xbt/backtrace_windows.c @@ -1,7 +1,7 @@ /* backtrace_windows - backtrace displaying on windows platform */ /* This file is included by ex.c on need (windows x86) */ -/* Copyright (c) 2008, 2009, 2010. The SimGrid Team. +/* Copyright (c) 2008-2015. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -12,7 +12,7 @@ * support for application self-debugging. */ -#if defined(_XBT_BORLAND_COMPILER) || defined(_XBT_VISUALC_COMPILER) +#if defined(_XBT_VISUALC_COMPILER) /* native windows build */ # include #else @@ -179,16 +179,16 @@ void xbt_ex_setup_backtrace(xbt_ex_t * e) int i; char **backtrace_syms; - xbt_assert(e - && e->used, - "Backtrace not setup yet, cannot set it up for display"); + xbt_assert(e, "Backtrace not setup yet, cannot set it up for display"); + + if (!e->used) + return; backtrace_syms = backtrace_symbols(e->bt, e->used); e->bt_strings = NULL; /* parse the output and build a new backtrace */ e->bt_strings = xbt_new(char *, e->used); - for (i = 0; i < e->used; i++) e->bt_strings[i] = backtrace_syms[i];