In Āryadevapāda's Skhalitapramathanayuktihetusiddhi we find a problematic passage in which some Cārvāka theories are expounded. The problem here lies in the fact that, according to Āryadevapāda, the Cārvākas-who did not admit rebirth-would have upheld that happiness in this life can be gained by worshipping gods and defeating demons. As the Cārvākas were materialists, the reference to gods and demons does not fit so much with their philosophical perspective. In this paper, by taking into account several passages from Pāli and Sanskrit Buddhist sources, I have tried to demonstrate that Āryadevapāda is here probably following the Laṅkāvatārasūtra, where mention is made of some Lokāyatikas who are said to have been able to infatuate gods and demons. In both the Pāli Canon and the Mahāyāna sūtras, however, the term lokāyata does not refer to 'materialism'. It rather conveys the meaning of 'art of disputation', and is generally used in the description of brāhmaṇas well versed in the Vedas, in the recitation of mantras and in dialectic methods in general. It is the Laṅkāvatārasūtra that introduces the idea-corroborated also by a passage from the Mahābhārata-that these brāhmaṇas, skilled in lokāyata, would have indulged in some materialistic tenet. When the two terms, Cārvāka and Lokāyata, came both to mean 'materialism', around the IV century CE, it is highly probable that non-Cārvāka thinkers and commentators-as could be the case of Āryadevapāda-had in some occasion assimilated and integrated certain points of view, originally belonging to the ancient lokāyata perspective (for instance, the references to gods and demons), into what they believed Cārvāka philosophy had to be. [ABSTRACT FROM AUTHOR]