-/* vm/tables.c -
+/* src/vm/tables.c -
Copyright (C) 1996-2005 R. Grafl, A. Krall, C. Kruegel, C. Oates,
R. Obermaisser, M. Platter, M. Probst, S. Ring, E. Steiner,
Changes: Mark Probst
Andreas Krall
+ Christian Thalinger
Contains support functions for:
- Reading of Java class files
- the heap
- additional support functions
- $Id: tables.c 2195 2005-04-03 16:53:16Z edwin $
+ $Id: tables.c 2505 2005-05-23 08:23:40Z twisti $
*/
u2 desc_to_type(utf *descriptor)
{
char *utf_ptr = descriptor->text; /* current position in utf text */
- char logtext[MAXLOGTEXT];
- if (descriptor->blength < 1) panic("Type-Descriptor is empty string");
+ if (descriptor->blength < 1) {
+ log_text("Type-Descriptor is empty string");
+ assert(0);
+ }
switch (*utf_ptr++) {
case 'B':
case '[': return TYPE_ADDRESS;
}
- sprintf(logtext, "Invalid Type-Descriptor: ");
- utf_sprint(logtext+strlen(logtext), descriptor);
- error("%s",logtext);
+ assert(0);
return 0;
}
/* Modified my Joseph Wenninger*/
+#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+
#include "zlib.h"
#include "unzip.h"
#include "mm/memory.h"
return;
do {
- if (unzGetCurrentFileInfo(file, &tmp, filename, 200, 0, 0, 0, 0) != UNZ_OK)
- panic("Error in ZIP archive");
+ if (unzGetCurrentFileInfo(file, &tmp, filename, 200, 0, 0, 0, 0) != UNZ_OK) {
+ log_text("Error in ZIP archive");
+ assert(0);
+ }
if ((c = strstr(filename, ".class")))
*c = '\0';