WALA icon indicating copy to clipboard operation
WALA copied to clipboard

makeSymbol in CAstWrapper appears to be implemented incorrectly

Open tiganov opened this issue 6 years ago • 1 comments

In CAstWrapper.cpp, it appears that makeSymbol is not implemented correctly as it does not pass a CAstType to the constructor it calls.

e.g. Here a constructor is declared which takes a String and CAstType as parameters.

  this->castSymbolInit1 = 
    env->GetMethodID(CAstSymbol, "<init>", "(Ljava/lang/String;Lcom/ibm/wala/cast/tree/CAstType;)V");

but later only a String is given to the constructor.

jobject CAstWrapper::makeSymbol(const char *name) {
  jobject val = env->NewStringUTF( name );

  jobject s = env->NewObject(CAstSymbol, castSymbolInit1, val); // <<<<<<<<<
  THROW_ANY_EXCEPTION(java_ex);

  LOG(s);
  return s;
}

This applies to all variants of the makeSymbol call in CAstWrapper.cpp.

tiganov avatar Jul 02 '19 19:07 tiganov

@juliandolby can you take a look?

msridhar avatar Sep 05 '19 15:09 msridhar