Clang: error accessing vector

Hi to everybody.
I'm getting the following error while working on a Clang plugin:

error: call to a function
'std::vector<clang::CallExpr*,std::allocator&lt;clang::CallExpr*>

::operator[](unsigned long)' that is not present in the target

The interesting code is the following:

Expr*
OpenCLKernelCallDiscover::findParamSizeAttribute(vector<CallExpr*>&
attributes, string name) {
    for(int i = 0; i < attributes.size(); i++) {
        if(attributes.at(i)->getDirectCallee()->getName().str() ==
"call_this_opencl_buffer_size") {
            Expr* param = attributes[i]->getArg(0);
            // Attribute first arg must be a call (buffer) arg name
            if(param->isEvaluatable(context)) {
                string param_name;
                llvm::raw_string_ostream stream(param_name);
                param->printPretty(stream, NULL,
context.getPrintingPolicy());
                                
                if(param_name == name) {
                    int arg = attributes.at(i)->getNumArgs();
                    Expr* size_arg = attributes.at(i)->getArg(1);
                    size_arg->dump();
                    printf(" OK\n");
                    return size_arg;
                }
            }
        }
    }
    return NULL;
}

The problem is that I'm getting erroneous values for some of the variables
in the code, such as size_arg. I argue the error reported affects the
correctness of the entire function body.

I tried to google the error with ne results.
Can you help me?
Thank you very much!

Please send issues with lldb to lldb-dev.

-Eli