Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'master' of github.com:steveicarus/iverilog

  • Loading branch information...
commit a90e264ed752653836c81d0e5db957fcd893f1ce 2 parents eaa315f + b098e31
Stephen Williams authored
4 cppcheck.sup
View
@@ -1,3 +1,3 @@
// These are correct and are used to find the base (zero) pin.
-thisSubtraction:netlist.h:4347
-thisSubtraction:netlist.h:4356
+thisSubtraction:netlist.h:4430
+thisSubtraction:netlist.h:4439
2  elab_net.cc
View
@@ -553,7 +553,7 @@ NetNet* PEIdent::elaborate_lnet_common_(Design*des, NetScope*scope,
// itself.
ivl_assert(*this, member->packed_dims.size() <= 1);
ivl_assert(*this, path_tail.index.size() <= 1);
- if (path_tail.index.size() > 0) {
+ if (! path_tail.index.empty()) {
long tmp_off;
unsigned long tmp_wid;
const index_component_t&tail_sel = path_tail.index.back();
3  vvp/class_type.cc
View
@@ -47,7 +47,7 @@ void compile_class_start(char*lab, char*nam, unsigned ntype)
assert(compile_class == 0);
compile_class = new class_type(nam, ntype);
compile_vpi_symbol(lab, compile_class);
- delete[]lab;
+ free(lab);
delete[]nam;
}
@@ -64,4 +64,3 @@ void compile_class_done(void)
scope->classes[compile_class->class_name()] = compile_class;
compile_class = 0;
}
-
6 vvp/codes.cc
View
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001-2011 Stephen Williams (steve@icarus.com)
+ * Copyright (c) 2001-2012 Stephen Williams (steve@icarus.com)
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
@@ -117,6 +117,10 @@ void codespace_delete(void)
exec_ufunc_delete((cur+idx));
} else if ((cur+idx)->opcode == &of_FILE_LINE) {
delete((cur+idx)->handle);
+ } else if (((cur+idx)->opcode == &of_CONCATI_STR) ||
+ ((cur+idx)->opcode == &of_NEW_DARRAY) ||
+ ((cur+idx)->opcode == &of_PUSHI_STR)) {
+ delete [] ((cur+idx)->text);
}
if (count_opcodes == 0) break;
}
1  vvp/main.cc
View
@@ -218,6 +218,7 @@ static void final_cleanup()
dec_str_delete();
modpath_delete();
vpi_handle_delete();
+ vpi_stack_delete();
udp_defns_delete();
island_delete();
signal_pool_delete();
12 vvp/vpi_cobject.cc
View
@@ -20,6 +20,10 @@
# include "compile.h"
# include "vpi_priv.h"
+# include "config.h"
+#ifdef CHECK_WITH_VALGRIND
+# include "vvp_cleanup.h"
+#endif
__vpiCobjectVar::__vpiCobjectVar(__vpiScope*sc, const char*na, vvp_net_t*ne)
: __vpiBaseVar(sc, na, ne)
@@ -48,3 +52,11 @@ vpiHandle vpip_make_cobject_var(const char*name, vvp_net_t*net)
return obj;
}
+
+#ifdef CHECK_WITH_VALGRIND
+void class_delete(vpiHandle item)
+{
+ class __vpiCobjectVar*obj = dynamic_cast<__vpiCobjectVar*>(item);
+ delete obj;
+}
+#endif
8 vvp/vpi_darray.cc
View
@@ -76,3 +76,11 @@ vpiHandle vpip_make_darray_var(const char*name, vvp_net_t*net)
return obj;
}
+
+#ifdef CHECK_WITH_VALGRIND
+void darray_delete(vpiHandle item)
+{
+ class __vpiDarrayVar*obj = dynamic_cast<__vpiDarrayVar*>(item);
+ delete obj;
+}
+#endif
9 vvp/vpi_priv.h
View
@@ -60,10 +60,11 @@ extern vpiHandle vpip_build_file_line(char*description,
#ifdef CHECK_WITH_VALGRIND
#define _vpiFromThr 0x1000001
# define _vpiNoThr 0
-# define _vpiVThr 1
-# define _vpiWord 2
-# define _vpi_at_PV 3
-# define _vpi_at_A 4
+# define _vpiString 1
+# define _vpiVThr 2
+# define _vpiWord 3
+# define _vpi_at_PV 4
+# define _vpi_at_A 5
#endif
6 vvp/vpi_scope.cc
View
@@ -100,7 +100,13 @@ static void delete_sub_scopes(struct __vpiScope *scope)
port_delete((scope->intern)[idx]);
break;
case vpiStringVar:
+ string_delete((scope->intern)[idx]);
+ break;
+ case vpiClassVar:
+ class_delete((scope->intern)[idx]);
+ break;
case vpiRegArray:
+ darray_delete((scope->intern)[idx]);
break;
default:
fprintf(stderr, "Need support for type: %d\n",
8 vvp/vpi_string.cc
View
@@ -82,3 +82,11 @@ vpiHandle vpip_make_string_var(const char*name, vvp_net_t*net)
return obj;
}
+
+#ifdef CHECK_WITH_VALGRIND
+void string_delete(vpiHandle item)
+{
+ class __vpiStringVar*obj = dynamic_cast<__vpiStringVar*>(item);
+ delete obj;
+}
+#endif
3  vvp/vpi_tasks.cc
View
@@ -843,6 +843,9 @@ void vpi_call_delete(vpiHandle item)
case _vpiNoThr:
constant_delete(obj->args[arg]);
break;
+ case _vpiString:
+ thread_string_delete(obj->args[arg]);
+ break;
case _vpiVThr:
thread_vthr_delete(obj->args[arg]);
break;
27 vvp/vpi_vthr_vector.cc
View
@@ -660,6 +660,10 @@ int __vpiVThrStrStack::vpi_get(int code)
switch (code) {
case vpiConstType:
return vpiStringConst;
+#ifdef CHECK_WITH_VALGRIND
+ case _vpiFromThr:
+ return _vpiString;
+#endif
default:
return 0;
}
@@ -698,3 +702,26 @@ vpiHandle vpip_make_vthr_str_stack(unsigned depth)
class __vpiVThrStrStack*obj = new __vpiVThrStrStack(depth);
return obj;
}
+
+#ifdef CHECK_WITH_VALGRIND
+static map<vpiHandle, bool> stack_map;
+
+void thread_string_delete(vpiHandle item)
+{
+ stack_map[item] = false;
+}
+
+static void thread_string_delete_real(vpiHandle item)
+{
+ class __vpiVThrStrStack*obj = dynamic_cast<__vpiVThrStrStack*>(item);
+ delete obj;
+}
+
+void vpi_stack_delete()
+{
+ map<vpiHandle, bool>::iterator iter;
+ for (iter = stack_map.begin(); iter != stack_map.end(); ++ iter ) {
+ thread_string_delete_real(iter->first);
+ }
+}
+#endif
5 vvp/vvp_cleanup.h
View
@@ -36,19 +36,24 @@ extern void root_table_delete(void);
extern void signal_pool_delete(void);
extern void udp_defns_delete(void);
extern void vpi_handle_delete(void);
+extern void vpi_stack_delete(void);
extern void vvp_net_pool_delete(void);
extern void ufunc_pool_delete(void);
extern void A_delete(class __vpiHandle *item);
extern void PV_delete(class __vpiHandle *item);
+extern void class_delete(class __vpiHandle *item);
extern void constant_delete(class __vpiHandle *item);
extern void contexts_delete(struct __vpiScope *scope);
+extern void darray_delete(class __vpiHandle *item);
extern void enum_delete(class __vpiHandle *item);
extern void memory_delete(class __vpiHandle *item);
extern void named_event_delete(class __vpiHandle *item);
extern void parameter_delete(class __vpiHandle *item);
extern void signal_delete(class __vpiHandle *item);
extern void real_delete(class __vpiHandle *item);
+extern void string_delete(class __vpiHandle *item);
+extern void thread_string_delete(class __vpiHandle *item);
extern void thread_vthr_delete(class __vpiHandle *item);
extern void thread_word_delete(class __vpiHandle *item);
extern void vpi_call_delete(class __vpiHandle *item);
Please sign in to comment.
Something went wrong with that request. Please try again.