X-Git-Url: https://git.saurik.com/cycript.git/blobdiff_plain/f95d2598051e347460e028286ff2d33e5825e548..c1d3e52e58e86c49f9d04e06ae8e0ece4b98250c:/Replace.cpp diff --git a/Replace.cpp b/Replace.cpp index b3d1c82..34c5cab 100644 --- a/Replace.cpp +++ b/Replace.cpp @@ -1,5 +1,5 @@ /* Cycript - Optimizing JavaScript Compiler/Runtime - * Copyright (C) 2009-2014 Jay Freeman (saurik) + * Copyright (C) 2009-2015 Jay Freeman (saurik) */ /* GNU Affero General Public License, Version 3 {{{ */ @@ -327,6 +327,10 @@ CYAssignment *CYExpression::Assignment(CYContext &context) { return NULL; } +CYStatement *CYExternal::Replace(CYContext &context) { + return $E($ CYAssign($V(typed_->identifier_), $C1(typed_->Replace(context), $C2($V("dlsym"), $V("RTLD_DEFAULT"), $S(typed_->identifier_->Word()))))); +} + CYNumber *CYFalse::Number(CYContext &context) { return $D(0); } @@ -402,7 +406,7 @@ CYFunctionParameter *CYForOfComprehension::Parameter(CYContext &context) const { } CYStatement *CYForOfComprehension::Replace(CYContext &context, CYStatement *statement) const { - CYIdentifier *cys($I("cys")); + CYIdentifier *cys($I("$cys")); return $E($C0($F(NULL, $P1($L("$cys")), $$->* $E($ CYAssign($V(cys), set_))->* @@ -955,6 +959,19 @@ CYExpression *CYTypedIdentifier::Replace(CYContext &context) { return modifier_->Replace(context, specifier_->Replace(context)); } +CYTypeFunctionWith *CYTypedIdentifier::Function() { + CYTypeModifier **modifier(&modifier_); + if (*modifier == NULL) + return NULL; + while ((*modifier)->next_ != NULL) + modifier = &(*modifier)->next_; + CYTypeFunctionWith *function((*modifier)->Function()); + if (function == NULL) + return NULL; + *modifier = NULL; + return function; +} + CYArgument *CYTypedParameter::Argument(CYContext &context) { $T(NULL) return $ CYArgument(typed_->Replace(context), next_->Argument(context)); }